00001 00002 /* Copyright (c) 2007-2008, Stefan Eilemann <eile@equalizergraphics.com> 00003 * 00004 * This library is free software; you can redistribute it and/or modify it under 00005 * the terms of the GNU Lesser General Public License version 2.1 as published 00006 * by the Free Software Foundation. 00007 * 00008 * This library is distributed in the hope that it will be useful, but WITHOUT 00009 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 00010 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 00011 * details. 00012 * 00013 * You should have received a copy of the GNU Lesser General Public License 00014 * along with this library; if not, write to the Free Software Foundation, Inc., 00015 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 00016 */ 00017 00018 #include "glXMessagePump.h" 00019 00020 #include "glXEventHandler.h" 00021 00022 #include <eq/base/debug.h> 00023 #include <eq/base/log.h> 00024 00025 using namespace std; 00026 00027 namespace eq 00028 { 00029 GLXMessagePump::GLXMessagePump() 00030 : _wakeupSet( 0 ) 00031 { 00032 } 00033 00034 GLXMessagePump::~GLXMessagePump() 00035 { 00036 _wakeupSet = 0; 00037 } 00038 00039 void GLXMessagePump::postWakeup() 00040 { 00041 if( !_wakeupSet ) 00042 { 00043 EQWARN << "Receiver thread not waiting?" << endl; 00044 return; 00045 } 00046 00047 _wakeupSet->interrupt(); 00048 } 00049 00050 void GLXMessagePump::dispatchOne() 00051 { 00052 if( !_wakeupSet ) 00053 _wakeupSet = GLXEventHandler::getEventSet(); 00054 00055 GLXEventHandler::dispatchOne(); 00056 } 00057 00058 void GLXMessagePump::dispatchAll() 00059 { 00060 if( !_wakeupSet ) 00061 _wakeupSet = GLXEventHandler::getEventSet(); 00062 00063 GLXEventHandler::dispatchAll(); 00064 } 00065 00066 void GLXMessagePump::dispatchDone() 00067 { 00068 if( !_wakeupSet ) 00069 return; 00070 00071 _wakeupSet = 0; 00072 GLXEventHandler::clearEventSet(); 00073 } 00074 00075 }
0.9 by
1.5.8