/usr/include/dclib-0.3/dclib/core/cmutex.h is in libdc-dev 0.3.24~svn3121-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | /***************************************************************************
cmutex.h - mutex
-------------------
begin : Sun Sep 30 2001
copyright : (C) 2001-2004 by Mathias Küster
email : mathen@users.berlios.de
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef CMUTEX_H
#define CMUTEX_H
/**
* @author Mathias Küster
*
* It's a mutex, only one thread can lock a mutex at a time, other threads
* attempting to lock it when it is already locked will be blocked until it
* is unlocked.
*
* It is not a recursive mutex, a thread locking an already locked mutex
* will permenantly hang.
*/
#ifndef WIN32
#include <pthread.h>
#endif
#include <dclib/dcos.h>
class CMutex {
public:
/** */
CMutex();
/** */
virtual ~CMutex();
/** */
int Lock();
/** */
bool TryLock();
/** */
int UnLock();
private:
#ifdef WIN32
/**
* Everything returns void so there's no bool with it.
* An exception may be thrown but dclib is not designed to
* handle running out of memory.
*/
CRITICAL_SECTION m_CS;
#else
/** */
bool m_bMutexInit;
/** */
pthread_mutex_t mutex;
#endif
};
#endif // CMUTEX_H
|