5.13.4. Importing Semaphore External Handles
5.13.4. 导入信号量外部句柄
Applications can import a semaphore payload into an existing semaphore using an external semaphore handle. The effects of the import operation will be either temporary or permanent, as specified by the application. If the import is temporary, the implementation must restore the semaphore to its prior permanent state after submitting the next semaphore wait operation. Performing a subsequent temporary import on a semaphore before performing a semaphore wait has no effect on this requirement; the next wait submitted on the semaphore must still restore its last permanent state. A permanent payload import behaves as if the target semaphore was destroyed, and a new semaphore was created with the same handle but the imported payload. Because importing a semaphore payload temporarily or permanently detaches the existing payload from a semaphore, similar usage restrictions to those applied to clReleaseSemaphoreKHR are applied to any command that imports a semaphore payload. Which of these import types is used is referred to as the import operation’s permanence. Each handle type supports either one or both types of permanence.
应用程序可以使用外部信号量句柄将信号量有效负载导入到现有的信号量中。导入操作的影响将是暂时的或永久的,具体由应用程序指定。如果导入是临时的,则实现必须在提交下一个信号量等待操作后将信号量恢复到其之前的永久状态。在执行信号量等待之前对信号量执行后续的临时导入对这一要求没有影响;在信号量上提交的下一个等待仍然必须恢复其最后的永久状态。永久有效载荷导入的行为就像目标信号量被销毁一样,并且使用相同的句柄创建了一个新的信号量,但导入了有效载荷。因为导入信号量有效负载会暂时或永久地将现有有效负载与信号量分离,所以与应用于clReleaseSemaphoreKHR的使用限制类似的使用限制也适用于导入信号量负载的任何命令。使用这些导入类型中的哪一种被称为导入操作的持久性。每种句柄类型都支持一种或两种持久性。
The implementation must perform the import operation by either referencing or copying the payload referred to by the specified external semaphore handle, depending on the handle’s type. The import method used is referred to as the handle type’s transference. When using handle types with reference transference, importing a payload to a semaphore adds the semaphore to the set of all semaphores sharing that payload. This set includes the semaphore from which the payload was exported. Semaphore signaling and waiting operations performed on any semaphore in the set must behave as if the set were a single semaphore. Importing a payload using handle types with copy transference creates a duplicate copy of the payload at the time of import, but makes no further reference to it. Semaphore signaling and waiting operations performed on the target of copy imports must not affect any other semaphore or payload.
实现必须通过引用或复制指定外部信号量句柄引用的有效载荷来执行导入操作,具体取决于句柄的类型。所使用的导入方法称为句柄类型的转换。当使用带有引用转移的句柄类型时,将有效载荷导入信号量会将该信号量添加到共享该有效载荷的所有信号量的集合中。该集合包括导出有效载荷的信号量。对集合中任何信号量执行的信号量信令和等待操作必须表现得就像该集合是单个信号量一样。使用带有复制传输的句柄类型导入有效负载会在导入时创建有效负载的重复副本,但不会进一步引用它。在副本导入的目标上执行的信号量信令和等待操作不得影响任何其他信号量或有效负载。
Export operations have the same transference as the specified handle type’s import operations. Additionally, exporting a semaphore payload to a handle with copy transference has the same side effects on the source semaphore’s payload as executing a semaphore wait operation. If the semaphore was using a temporarily imported payload, the semaphore’s prior permanent payload will be restored.
导出操作与指定句柄类型的导入操作具有相同的传递。此外,将信号量有效负载导出到具有复制传输的句柄,与执行信号量等待操作对源信号量的有效负载具有相同的副作用。如果信号量使用的是临时导入的有效载荷,则信号量之前的永久有效载荷将被恢复。
Please refer to handle specific specifications for more details on transference and permanence requirements specific to handle type.
请参阅手柄具体规范,了解手柄类型的转移和永久性要求的更多详细信息。
2927

被折叠的 条评论
为什么被折叠?



