RWLock_Android.cpp 689 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. //
  2. // RWLock_Android.cpp
  3. //
  4. // $Id: //poco/1.4/Foundation/src/RWLock_Android.cpp#1 $
  5. //
  6. // Library: Foundation
  7. // Package: Threading
  8. // Module: RWLock
  9. //
  10. // Copyright (c) 2004-2011, Applied Informatics Software Engineering GmbH.
  11. // and Contributors.
  12. //
  13. // SPDX-License-Identifier: BSL-1.0
  14. //
  15. #include "Poco/RWLock_Android.h"
  16. namespace Poco {
  17. RWLockImpl::RWLockImpl()
  18. {
  19. pthread_mutexattr_t attr;
  20. pthread_mutexattr_init(&attr);
  21. if (pthread_mutex_init(&_mutex, &attr))
  22. {
  23. pthread_mutexattr_destroy(&attr);
  24. throw SystemException("cannot create mutex");
  25. }
  26. pthread_mutexattr_destroy(&attr);}
  27. RWLockImpl::~RWLockImpl()
  28. {
  29. pthread_mutex_destroy(&_mutex);
  30. }
  31. } // namespace Poco