Main Page | Class Hierarchy | Compound List | File List | Compound Members | File Members

os.cc

Go to the documentation of this file.
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 "os.h"
00012 #include "taskimpl.h"
00013 
00014 Os::Os() :
00015   deadlockFnc(0),
00016   deadlockFncA(0),
00017   deadlockArg(0)
00018 {
00019   TaskImpl::boot = this;
00020 }
00021 
00022 Os::~Os()
00023 {
00024   TaskImpl::boot = 0;
00025 }
00026 
00027 void Os::setDeadlockHandler(void (*f)())
00028 {
00029   deadlockFnc = f;
00030   deadlockArg = 0;
00031 }
00032 
00033 void Os::setDeadlockHandler(void (*f)(void*), void* a)
00034 {
00035   deadlockFncA = f;
00036   deadlockArg = a;
00037 }
00038 
00039 bool Os::deadlockHandler()
00040 {
00041   if (deadlockFnc) {
00042     deadlockFnc();
00043   } else if (deadlockFncA) {
00044     deadlockFncA(deadlockArg);
00045   } else {
00046     return false;
00047   }
00048   return true;
00049 }

Generated on Wed Feb 15 14:52:39 2006 for yapi by doxygen 1.3.2