discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Discuss-gnuradio] thread safety of gr_wavfile_sink::close()


From: Don Ward
Subject: [Discuss-gnuradio] thread safety of gr_wavfile_sink::close()
Date: Fri, 30 Apr 2010 19:42:32 -0400

I have a question about the thread safety of gr_wavfile_sink::close(). The description says it is thread safe and it uses d_mutex, but what is to stop the work() function from writing the file at the same time that close() (via close_wav()) is writing and closing the file? gr_wavfile_sink::work() does not lock d_mutex (except when d_updated is set). Is there something going on behind the scenes to prevent the threads from mangling the output file, or is this a problem with the code?

The reason I am interested is because I would like to do something similar with gr_udp_sink, allowing one socket to be closed and a new one to be created when one client finishes and another client starts up.

Thanks,

-- Don W.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]