EntryPoint.h
Go to the documentation of this file.00001
00002 #ifndef INCLUDED_EntryPoint_h_
00003 #define INCLUDED_EntryPoint_h_
00004
00005 #include "IPC/Thread.h"
00006 #include "Shared/Resource.h"
00007
00008
00009 typedef Thread::Lock EntryPoint;
00010
00011
00012
00013
00014 explicit EntryPoint() : Resource(), lock() {}
00015
00016
00017 virtual void useResource(Data& d) {
00018 static_cast<Resource&>(lock).useResource(emptyData); //important to get lock first to make sure using shared defaultRead is safe in multi-threaded env.
00019 }
00020
00021 virtual void releaseResource(Data& d) {
00022 static_cast<Resource&>(lock).releaseResource(emptyData); //important to release lock last to make sure using shared defaultRead is safe in multi-threaded env.
00023 }
00024
00025
00026 Thread::Lock& getLock() { return lock; }
00027
00028 protected:
00029 Thread::Lock lock; //!< only one behavior runs at a time
00030 };
00031 */
00032
00033
00034
00035
00036
00037
00038 #endif