swsignal.h 728 B

123456789101112131415161718192021222324252627282930313233
  1. /************************************************************************
  2. * AUTHOR: NiuJiuRu
  3. * FILENAME: swsignal.h
  4. * DESCRIPTION: 信号量
  5. * NOTE: 主要用于状态通知
  6. * HISTORY:
  7. * 1, [2010-09-06] created by NiuJiuRu
  8. ***********************************************************************/
  9. #ifndef __SWSIGNAL_H__
  10. #define __SWSIGNAL_H__
  11. #ifdef __cplusplus
  12. extern "C"
  13. {
  14. #endif
  15. /* 创建信号量 */
  16. void *sw_signal_create();
  17. /* 销毁信号量 */
  18. void sw_signal_destroy(void *hSignal);
  19. /* 等待信号量, timeout(ms) = -1时表示无限等待 */
  20. int sw_signal_wait(void *hSignal, int timeout);
  21. /* 点亮信号量 */
  22. void sw_signal_give(void *hSignal);
  23. #ifdef __cplusplus
  24. }
  25. #endif
  26. #endif /* __SWSIGNAL_H__ */