00001 /*-------------------------------------------------------------------- 00002 * 00003 * (C) Copyright Koninklijke Philips Electronics NV 2006. 00004 * All rights reserved. This software is licensed under the terms of 00005 * version 2.1 of the GNU Lesser General Public License as published 00006 * by the Free Software Foundation. For licensing and warranty 00007 * information, see the file COPYING in the main directory. 00008 * 00009 *------------------------------------------------------------------*/ 00010 00011 #include "trtsemaphore.h" 00012 #include "trt.h" 00013 00014 trtSemaphore::trtSemaphore(int credit) 00015 { 00016 sem_init(&ps, credit, "trtSemaphore"); 00017 } 00018 00019 trtSemaphore::~trtSemaphore() 00020 { } 00021 00022 void trtSemaphore::wait() 00023 { 00024 sem_P(&ps); 00025 } 00026 00027 void trtSemaphore::signal() 00028 { 00029 sem_V(&ps); 00030 }