Merge branch 'libusb-1.0' of git://github.com/ttsou/gnuradio-ttsou
[debian/gnuradio] / gnuradio-core / src / lib / io / gr_udp_source.cc
index c65947ba6caf565fe5a49b6ee7f8505879f6c5a8..d76d0ee32fcd5ef5ab21d2b4a2ab5373d4485f46 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
  * 
@@ -27,6 +27,8 @@
 #include <gr_io_signature.h>
 #include <stdexcept>
 #include <errno.h>
+#include <stdio.h>
+#include <string.h>
 #if defined(HAVE_SOCKET)
 #include <netdb.h>
 typedef void* optval_t;
@@ -88,7 +90,7 @@ gr_udp_source::~gr_udp_source ()
 bool
 gr_udp_source::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
   d_socket = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP);
   if(d_socket == -1) {
@@ -135,7 +137,7 @@ gr_udp_source::open()
 void
 gr_udp_source::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);