PageRenderTime 951ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/libtunepimp-0.5.3/lib/threads/posix/mutex.h

#
C Header | 50 lines | 17 code | 7 blank | 26 comment | 0 complexity | 674a6757a0eafdac88a4a0b6dfea06b6 MD5 | raw file
Possible License(s): LGPL-2.1, LGPL-3.0, GPL-2.0, LGPL-2.0
  1. /*----------------------------------------------------------------------------
  2. libtunepimp -- The MusicBrainz tagging library.
  3. Let a thousand taggers bloom!
  4. Copyright (C) Robert Kaye 2003
  5. This file is part of libtunepimp.
  6. libtunepimp is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; either version 2 of the License, or
  9. (at your option) any later version.
  10. libtunepimp is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. GNU General Public License for more details.
  14. You should have received a copy of the GNU General Public License
  15. along with libtunepimp; if not, write to the Free Software
  16. Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  17. $Id: mutex.h 1110 2003-06-23 09:27:19Z robert $
  18. ----------------------------------------------------------------------------*/
  19. #ifndef __MUTEX_H__
  20. #define __MUTEX_H__
  21. #include <pthread.h>
  22. class Mutex
  23. {
  24. public:
  25. Mutex(void);
  26. virtual ~Mutex(void);
  27. virtual void acquire(void);
  28. virtual void release(void);
  29. private:
  30. pthread_t owner;
  31. pthread_mutex_t mutex;
  32. pthread_cond_t cond;
  33. int busyCount;
  34. };
  35. #endif