Files
platform-external-webrtc/src/system_wrappers/source/rw_lock_posix.h
henrike@webrtc.org 9f84723725 Some style fixes.
Refactors the rw lock implementation.

BUG=N/A

Review URL: https://webrtc-codereview.appspot.com/797004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@2822 4adac7df-926f-26a2-2b94-8c16560cd09d
2012-09-25 20:27:51 +00:00

42 lines
1.0 KiB
C++

/*
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef WEBRTC_SYSTEM_WRAPPERS_SOURCE_RW_LOCK_POSIX_H_
#define WEBRTC_SYSTEM_WRAPPERS_SOURCE_RW_LOCK_POSIX_H_
#include "system_wrappers/interface/rw_lock_wrapper.h"
#include <pthread.h>
namespace webrtc {
class RWLockPosix : public RWLockWrapper
{
public:
static RWLockPosix* Create();
virtual ~RWLockPosix();
virtual void AcquireLockExclusive();
virtual void ReleaseLockExclusive();
virtual void AcquireLockShared();
virtual void ReleaseLockShared();
private:
RWLockPosix();
bool Init();
pthread_rwlock_t _lock;
};
} // namespace webrtc
#endif // WEBRTC_SYSTEM_WRAPPERS_SOURCE_RW_LOCK_POSIX_H_