diff options
author | Martin Braun <martin.braun@ettus.com> | 2017-03-22 23:02:00 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2017-04-12 12:20:43 -0700 |
commit | ba04a5f652e6eec19865a67f163a5dc1f7294e45 (patch) | |
tree | a310fbbc09fd2066f71a329c8edf6bff2c273816 /host/lib/usrp/common | |
parent | 2ae347f12ed1ba42f65a800b6ebf3779ee3195c2 (diff) | |
download | uhd-ba04a5f652e6eec19865a67f163a5dc1f7294e45.tar.gz uhd-ba04a5f652e6eec19865a67f163a5dc1f7294e45.tar.bz2 uhd-ba04a5f652e6eec19865a67f163a5dc1f7294e45.zip |
utils: Replaced uhd::atomic_uint32_t with std::atomic
Diffstat (limited to 'host/lib/usrp/common')
-rw-r--r-- | host/lib/usrp/common/recv_packet_demuxer_3000.hpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/host/lib/usrp/common/recv_packet_demuxer_3000.hpp b/host/lib/usrp/common/recv_packet_demuxer_3000.hpp index a970e81a5..2fe534c03 100644 --- a/host/lib/usrp/common/recv_packet_demuxer_3000.hpp +++ b/host/lib/usrp/common/recv_packet_demuxer_3000.hpp @@ -1,5 +1,5 @@ // -// Copyright 2013 Ettus Research LLC +// Copyright 2013,2017 Ettus Research LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -84,7 +84,7 @@ namespace uhd{ namespace usrp{ //---------------------------------------------------------- //-- Try to claim the transport or wait patiently //---------------------------------------------------------- - if (_claimed.cas(1, 0)) + if (_claimed.exchange(true)) { boost::mutex::scoped_lock l(mutex); cond.timed_wait(l, boost::posix_time::microseconds(long(timeout*1e6))); @@ -111,7 +111,7 @@ namespace uhd{ namespace usrp{ } } #ifdef RECV_PACKET_DEMUXER_3000_THREAD_SAFE - _claimed.write(0); + _claimed = false; cond.notify_all(); #endif // RECV_PACKET_DEMUXER_3000_THREAD_SAFE } @@ -133,7 +133,7 @@ namespace uhd{ namespace usrp{ std::map<uint32_t, queue_type_t> _queues; transport::zero_copy_if::sptr _xport; #ifdef RECV_PACKET_DEMUXER_3000_THREAD_SAFE - uhd::atomic_uint32_t _claimed; + std::atomic_bool _claimed; boost::condition_variable cond; #endif // RECV_PACKET_DEMUXER_3000_THREAD_SAFE boost::mutex mutex; |