Semaphore.xml 1.0 KB

12345678910111213141516171819202122232425262728293031
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="Semaphore" inherits="Reference" category="Core" version="3.1">
  3. <brief_description>
  4. A synchronization Semaphore.
  5. </brief_description>
  6. <description>
  7. A synchronization Semaphore. Element used to synchronize multiple [Thread]s. Initialized to zero on creation. Be careful to avoid deadlocks. For a binary version, see [Mutex].
  8. </description>
  9. <tutorials>
  10. </tutorials>
  11. <demos>
  12. </demos>
  13. <methods>
  14. <method name="post">
  15. <return type="int" enum="Error">
  16. </return>
  17. <description>
  18. Lowers the [code]Semaphore[/code], allowing one more thread in. Returns [code]OK[/code] on success, [code]ERR_BUSY[/code] otherwise.
  19. </description>
  20. </method>
  21. <method name="wait">
  22. <return type="int" enum="Error">
  23. </return>
  24. <description>
  25. Tries to wait for the [code]Semaphore[/code], if its value is zero, blocks until non-zero. Returns [code]OK[/code] on success, [code]ERR_BUSY[/code] otherwise.
  26. </description>
  27. </method>
  28. </methods>
  29. <constants>
  30. </constants>
  31. </class>