使用 SDL;
過程SDL_DestroySemaphore sem:PSDL_sem;
SDL_DestroySemaphore向前在被 SDL_CreateSemaphore建立sem旁邊毀滅削尖信號機.如果有現時堵住有待於它線,它是並不安全毀滅一台信號機.
如果那時(my_sem<>零)開始 SDL_DestroySemaphore((my_sem); my_sem:=零;末端;
SDL_CreateSemaphore ,SDL_SemWait, SDL_SemTryWait, SDL_SemWaitTimeout, SDL_SemPost,SDL_SemValue