From e7b98030eb3ea7e42bd8d6fa5f115b0219ae2685 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Mon, 22 Nov 2010 12:23:04 -0800 Subject: usrp2: ms didnt seem to like unlocking an unlocked mutex --- host/lib/usrp/usrp2/io_impl.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'host/lib') diff --git a/host/lib/usrp/usrp2/io_impl.cpp b/host/lib/usrp/usrp2/io_impl.cpp index 4d9528f66..4b498ff7f 100644 --- a/host/lib/usrp/usrp2/io_impl.cpp +++ b/host/lib/usrp/usrp2/io_impl.cpp @@ -165,8 +165,7 @@ void usrp2_impl::io_init(void){ //create a new pirate thread for each zc if (yarr!!) for (size_t i = 0; i < _data_transports.size(); i++){ - //ensure a non-blocking mutex lock - _io_impl->spawn_mutex.unlock(); + //lock the unlocked mutex (non-blocking) _io_impl->spawn_mutex.lock(); //spawn a new pirate to plunder the recv booty _io_impl->recv_pirate_crew.create_thread(boost::bind( @@ -174,8 +173,10 @@ void usrp2_impl::io_init(void){ _io_impl.get(), _data_transports.at(i), _mboards.at(i), i )); - //will block here until the thread unlocks + //block here until the spawned thread unlocks _io_impl->spawn_mutex.lock(); + //exit loop iteration in an unlocked condition + _io_impl->spawn_mutex.unlock(); } } -- cgit v1.2.3