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