Mutex.xml 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="Mutex" inherits="Reference" category="Core" version="3.1">
  3. <brief_description>
  4. A synchronization Mutex.
  5. </brief_description>
  6. <description>
  7. A synchronization Mutex. Element used to synchronize multiple [Thread]s. Basically a binary [Semaphore]. Guarantees that only one thread can ever acquire this lock at a time. Can be used to protect a critical section. Be careful to avoid deadlocks.
  8. </description>
  9. <tutorials>
  10. </tutorials>
  11. <demos>
  12. </demos>
  13. <methods>
  14. <method name="lock">
  15. <return type="void">
  16. </return>
  17. <description>
  18. Lock this [code]Mutex[/code], blocks until it is unlocked by the current owner.
  19. </description>
  20. </method>
  21. <method name="try_lock">
  22. <return type="int" enum="Error">
  23. </return>
  24. <description>
  25. Try locking this [code]Mutex[/code], does not block. Returns [OK] on success, [ERR_BUSY] otherwise.
  26. </description>
  27. </method>
  28. <method name="unlock">
  29. <return type="void">
  30. </return>
  31. <description>
  32. Unlock this [code]Mutex[/code], leaving it to other threads.
  33. </description>
  34. </method>
  35. </methods>
  36. <constants>
  37. </constants>
  38. </class>