LotusScript被设计为线程安全的,这意味着它使用信号量保护数据结构,从而保护装载的每个LotusScript实例。
LotusScript is designed to be thread-safe, which means it USES semaphores to protect data structures so that each loaded instance of LotusScript is protected.
args是这个信号量集数据结构中要通过IPC_SET来更新的值(在这个例子中会有解释)。
Args are the values to be updated in the semaphore set data structure through this IPC_SET (explained in the sample).
为了对信号量集数据结构进行初始化,可以使用IPC_SET命令来调用semctl系统调用。
In order to initialize the semaphore-set data structure, use the semctl system call with the IPC_SET command.
这个命令将立即删除信号量集及其数据结构,并唤醒所有正在等待的进程(如果发生错误,则返回,并将errno设置为EIDRM)。
This command immediately removes the semaphore set and its data structures, awakening all waiting processes (with an error return and errno set to EIDRM).
写进程排队等待访问这个数据结构,在这个信号量可用之前会一直阻塞。
The writer process (es) lines up to access the data structure, and is held back until the semaphore is made available.
写进程排队等待访问这个数据结构,在这个信号量可用之前会一直阻塞。
The writer process (es) lines up to access the data structure, and is held back until the semaphore is made available.
应用推荐