Make Scheme hooks and timers threadsafe
[clinton/bobotpp.git] / source / ServerQueueItem.C
index 8fa879f..8daf8c4 100644 (file)
@@ -14,7 +14,8 @@
 
 // You should have received a copy of the GNU General Public License
 // along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+// 02110-1301, USA.
 
 #include "StringTokenizer.H"
 #include "ServerQueue.H"
@@ -24,21 +25,23 @@ ServerQueueItem::ServerQueueItem(int pr, int pen, int t)
   : priority(pr), penalty(pen), type(t)
 { }
 
-
-
 ServerQueueOtherItem::ServerQueueOtherItem(String l, int pr,
                                            int pen, int t)
   : ServerQueueItem(pr, pen, t), line(l)
 { }
 
+bool ServerQueueItem::operator< (const ServerQueueItem & item)
+{ 
+  // lower numeric priority is higher priority
+  return item.priority < priority; 
+}
+
 String
 ServerQueueOtherItem::getLine()
 {
   return line;
 }
 
-
-
 ServerQueueChannelModeItem::ServerQueueChannelModeItem(String c, String m, String p)
   : ServerQueueItem(CHANNELMODE_PRIORITY,
                     CHANNELMODE_PENALTY,