event.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. // Copyright 2014 Citra Emulator Project
  2. // Licensed under GPLv2
  3. // Refer to the license.txt file included.
  4. #pragma once
  5. #include "common/common_types.h"
  6. #include "core/hle/kernel/kernel.h"
  7. #include "core/hle/svc.h"
  8. namespace Kernel {
  9. /**
  10. * Changes whether an event is locked or not
  11. * @param handle Handle to event to change
  12. * @param locked Boolean locked value to set event
  13. * @return Result of operation, 0 on success, otherwise error code
  14. */
  15. ResultCode SetEventLocked(const Handle handle, const bool locked);
  16. /**
  17. * Hackish function to set an events permanent lock state, used to pass through synch blocks
  18. * @param handle Handle to event to change
  19. * @param permanent_locked Boolean permanent locked value to set event
  20. * @return Result of operation, 0 on success, otherwise error code
  21. */
  22. ResultCode SetPermanentLock(Handle handle, const bool permanent_locked);
  23. /**
  24. * Signals an event
  25. * @param handle Handle to event to signal
  26. * @return Result of operation, 0 on success, otherwise error code
  27. */
  28. ResultCode SignalEvent(const Handle handle);
  29. /**
  30. * Clears an event
  31. * @param handle Handle to event to clear
  32. * @return Result of operation, 0 on success, otherwise error code
  33. */
  34. ResultCode ClearEvent(Handle handle);
  35. /**
  36. * Creates an event
  37. * @param reset_type ResetType describing how to create event
  38. * @param name Optional name of event
  39. * @return Handle to newly created Event object
  40. */
  41. Handle CreateEvent(const ResetType reset_type, const std::string& name="Unknown");
  42. } // namespace