Skip to content

Instantly share code, notes, and snippets.

@rwtolbert
rwtolbert / gist:9f7a360a6d6206c05ebaf2dace847a33
Created October 30, 2019 00:18
one more sanitizer warning
WARNING: ThreadSanitizer: data race (pid=64090)
Read of size 4 at 0x7b4400001500 by thread T8:
#0 oatpp::async::Processor::pushQueues() Processor.cpp:176 (oatppAllTests:x86_64+0x10042837f)
#1 oatpp::async::Processor::iterate(int) Processor.cpp:205 (oatppAllTests:x86_64+0x100428767)
#2 oatpp::async::Executor::SubmissionProcessor::run() Executor.cpp:50 (oatppAllTests:x86_64+0x10040cca9)
#3 decltype(*(std::__1::forward<oatpp::async::Executor::SubmissionProcessor*>(fp0)).*fp()) std::__1::__invoke<void (oatpp::async::Executor::SubmissionProcessor::*)(), oatpp::async::Executor::SubmissionProcessor*, void>(void (oatpp::async::Executor::SubmissionProcessor::*&&)(), oatpp::async::Executor::SubmissionProcessor*&&) type_traits:4280 (oatppAllTests:x86_64+0x10041645b)
#4 void std::__1::__thread_execute<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void (oatpp::async::Executor::SubmissionProcessor::*)(), oatpp::async::Executor::SubmissionProcess
@rwtolbert
rwtolbert / gist:671a775c5853d95863f52bb93062cdc5
Created October 30, 2019 00:15
thread sanitizer stack trace
WARNING: ThreadSanitizer: data race (pid=64090)
Write of size 8 at 0x7b4400001630 by thread T2:
#0 oatpp::collection::FastQueue<oatpp::async::CoroutineHandle>::pushBack(oatpp::async::CoroutineHandle*) FastQueue.hpp:63 (oatppAllTests:x86_64+0x10040c3e9)
#1 oatpp::async::Processor::pushOneTask(oatpp::async::CoroutineHandle*) Processor.cpp:114 (oatppAllTests:x86_64+0x1004276d4)
#2 oatpp::async::CoroutineWaitList::notifyFirst() CoroutineWaitList.cpp:69 (oatppAllTests:x86_64+0x10040c55a)
#3 oatpp::async::Lock::unlock() Lock.cpp:68 (oatppAllTests:x86_64+0x10042486e)
#4 oatpp::async::LockGuard::unlock() Lock.cpp:159 (oatppAllTests:x86_64+0x100425178)
#5 oatpp::test::async::(anonymous namespace)::TestCoroutine::writeSymbol() LockTest.cpp:79 (oatppAllTests:x86_64+0x10000f926)
#6 oatpp::async::Coroutine<oatpp::test::async::(anonymous namespace)::TestCoroutine>::call(oatpp::async::Action (oatpp::async::AbstractCoroutine::* const&)()) Coroutine.hpp:570 (oatppAllTests:x86_64+0x10000f5f8)
@rwtolbert
rwtolbert / clint-progress.hy
Created March 14, 2014 13:51
clint-progress.hy
(import [clint.textui [progress]]
[time [sleep]]
[random [random]])
(for [x (.bar progress (range 100))]
(sleep (* (random) 0.1)))
@rwtolbert
rwtolbert / attr.hy
Created December 29, 2013 21:14
field/attribute access
(defmacro has-field [obj field]
`(hasattr ~obj ~field))
(defmacro set-field [obj field value]
`(setattr ~obj ~field ~value))
(defmacro get-field [obj field]
`(getattr ~obj ~field))
(defclass Cat []