1 // BotThreading.H -*- C++ -*-
2 // Copyright (c) 2008 Clinton Ebadi
4 // This program is free software; you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation; either version 2 of the License, or
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
14 // You should have received a copy of the GNU General Public License
15 // along with this program; if not, write to the Free Software
16 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19 // Basic Mutex and automatic lock interface that falls back to noops
20 // (wasting one byte of space for each fake mutex...oh well) in the
21 // absence of threading. This is intended to be used to ensure that
22 // multiple Guile threads can call the bot without corrupting its data
23 // structures without forcing pthreads or locking overhead on the
24 // usual single threaded standalone bot
26 #ifndef BOT_THREADING_H
27 #define BOT_THREADING_H
40 pthread_mutex_t mutex;
51 // Interface to automatically acquire and release a BotMutex within a
58 BotLock (BotMutex & m);