diff options
author | Mathias Agopian <mathias@google.com> | 2010-07-14 17:59:35 -0700 |
---|---|---|
committer | Mathias Agopian <mathias@google.com> | 2010-07-14 17:59:35 -0700 |
commit | 81bac09fa6b01dd1495644d9c825c3666762fced (patch) | |
tree | 346e826932eef1b4402dfa98796075e63d3c90e8 /libs/surfaceflinger/Barrier.h | |
parent | e1ea0811de760256cee3b1ffca227251e1cf52c5 (diff) | |
download | frameworks_native-81bac09fa6b01dd1495644d9c825c3666762fced.zip frameworks_native-81bac09fa6b01dd1495644d9c825c3666762fced.tar.gz frameworks_native-81bac09fa6b01dd1495644d9c825c3666762fced.tar.bz2 |
move native services under services/
moved surfaceflinger, audioflinger, cameraservice
all native services should now reside in this location.
Change-Id: Iee42b83dd2a94c3bf5107ab0895fe2dfcd5337a8
Diffstat (limited to 'libs/surfaceflinger/Barrier.h')
-rw-r--r-- | libs/surfaceflinger/Barrier.h | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/libs/surfaceflinger/Barrier.h b/libs/surfaceflinger/Barrier.h deleted file mode 100644 index 6f8507e..0000000 --- a/libs/surfaceflinger/Barrier.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (C) 2007 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef ANDROID_BARRIER_H -#define ANDROID_BARRIER_H - -#include <stdint.h> -#include <sys/types.h> -#include <utils/threads.h> - -namespace android { - -class Barrier -{ -public: - inline Barrier() : state(CLOSED) { } - inline ~Barrier() { } - void open() { - Mutex::Autolock _l(lock); - state = OPENED; - cv.broadcast(); - } - void close() { - Mutex::Autolock _l(lock); - state = CLOSED; - } - void wait() const { - Mutex::Autolock _l(lock); - while (state == CLOSED) { - cv.wait(lock); - } - } -private: - enum { OPENED, CLOSED }; - mutable Mutex lock; - mutable Condition cv; - volatile int state; -}; - -}; // namespace android - -#endif // ANDROID_BARRIER_H |