blob: a5ec36730ba7710f9c295560ee0cebdcbe0988df [file] [log] [blame]
niklase@google.com470e71d2011-07-07 08:21:25 +00001/*
2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
ajm@google.comb5c49ff2011-08-01 17:04:04 +000011#ifndef WEBRTC_SYSTEM_WRAPPERS_SOURCE_CRITICAL_SECTION_POSIX_H_
12#define WEBRTC_SYSTEM_WRAPPERS_SOURCE_CRITICAL_SECTION_POSIX_H_
niklase@google.com470e71d2011-07-07 08:21:25 +000013
phoglund@webrtc.org99f7c912012-11-30 10:44:49 +000014#include "webrtc/system_wrappers/interface/critical_section_wrapper.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000015
16#include <pthread.h>
17
18namespace webrtc {
niklase@google.com470e71d2011-07-07 08:21:25 +000019
phoglund@webrtc.org99f7c912012-11-30 10:44:49 +000020class CriticalSectionPosix : public CriticalSectionWrapper {
21 public:
22 CriticalSectionPosix();
niklase@google.com470e71d2011-07-07 08:21:25 +000023
phoglund@webrtc.org99f7c912012-11-30 10:44:49 +000024 virtual ~CriticalSectionPosix();
niklase@google.com470e71d2011-07-07 08:21:25 +000025
pbos@webrtc.orga2a27182013-08-01 17:26:15 +000026 virtual void Enter() OVERRIDE;
27 virtual void Leave() OVERRIDE;
phoglund@webrtc.org99f7c912012-11-30 10:44:49 +000028
29 private:
30 pthread_mutex_t mutex_;
31 friend class ConditionVariablePosix;
niklase@google.com470e71d2011-07-07 08:21:25 +000032};
phoglund@webrtc.org99f7c912012-11-30 10:44:49 +000033
pbos@webrtc.orgd900e8b2013-07-03 15:12:26 +000034} // namespace webrtc
niklase@google.com470e71d2011-07-07 08:21:25 +000035
phoglund@webrtc.org99f7c912012-11-30 10:44:49 +000036#endif // WEBRTC_SYSTEM_WRAPPERS_SOURCE_CRITICAL_SECTION_POSIX_H_