]> git.vomp.tv Git - vompclient.git/blob - mutex.h
Update for windows
[vompclient.git] / mutex.h
1 /*\r
2     Copyright 2004-2005 Chris Tallon\r
3 \r
4     This file is part of VOMP.\r
5 \r
6     VOMP is free software; you can redistribute it and/or modify\r
7     it under the terms of the GNU General Public License as published by\r
8     the Free Software Foundation; either version 2 of the License, or\r
9     (at your option) any later version.\r
10 \r
11     VOMP is distributed in the hope that it will be useful,\r
12     but WITHOUT ANY WARRANTY; without even the implied warranty of\r
13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
14     GNU General Public License for more details.\r
15 \r
16     You should have received a copy of the GNU General Public License\r
17     along with VOMP; if not, write to the Free Software\r
18     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\r
19 */\r
20 \r
21 #ifndef MUTEX_H\r
22 #define MUTEX_H\r
23 \r
24 #ifndef WIN32\r
25 #include <pthread.h>\r
26 #else\r
27 #include <winsock2.h>\r
28 #include <windows.h>\r
29 #endif\r
30 \r
31 \r
32 \r
33 class Mutex\r
34 {\r
35 public:\r
36         Mutex();\r
37         ~Mutex();\r
38         void Lock();\r
39         void Unlock();\r
40 protected:\r
41 #ifndef WIN32\r
42          pthread_mutex_t my_mutex;\r
43 #else\r
44         HANDLE my_mutex;\r
45 #endif\r
46 };\r
47 #endif\r