Merge r11462:11485 from jcorgan/omni into trunk.
[debian/gnuradio] / gnuradio-core / src / lib / io / gr_udp_sink.cc
index 215eaf8d556c0a120f0ac49320617b860af8d806..d37adfb8a8cf780f996ba6a1b1f7cc566d06e450 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2007,2008 Free Software Foundation, Inc.
+ * Copyright 2007,2008,2009 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -36,6 +36,8 @@ typedef void* optval_t;
 typedef char* optval_t;
 #endif
 
+#include <gruel/thread.h>
+
 #define SNK_VERBOSE 0
 
 gr_udp_sink::gr_udp_sink (size_t itemsize, 
@@ -110,7 +112,7 @@ gr_udp_sink::~gr_udp_sink ()
 bool
 gr_udp_sink::open()
 {
-  omni_mutex_lock l(d_mutex);  // hold mutex for duration of this function
+  gruel::scoped_lock guard(d_mutex);   // hold mutex for duration of this function
 
   // create socket
   if((d_socket = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) == -1) {
@@ -153,7 +155,7 @@ gr_udp_sink::open()
 void
 gr_udp_sink::close()
 {
-  omni_mutex_lock l(d_mutex);  // hold mutex for duration of this function
+  gruel::scoped_lock guard(d_mutex);   // hold mutex for duration of this function
 
   if (d_socket){
     shutdown(d_socket, SHUT_RDWR);