mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 04:06:45 +01:00
replace top level mutex with rw lock
This commit is contained in:
parent
33de8bbf1d
commit
2989c79fd0
5 changed files with 21 additions and 15 deletions
|
|
@ -43,7 +43,7 @@ pub use ::_jack::{
|
|||
};
|
||||
|
||||
/// Just run thing with JACK. Returns the activated client.
|
||||
pub fn jack_run <T> (name: &str, app: &Arc<Mutex<T>>) -> Usually<DynamicAsyncClient>
|
||||
pub fn jack_run <T: Sync> (name: &str, app: &Arc<RwLock<T>>) -> Usually<DynamicAsyncClient>
|
||||
where T: Handle + Process + Send + 'static
|
||||
{
|
||||
let options = ClientOptions::NO_START_SERVER;
|
||||
|
|
@ -59,7 +59,7 @@ pub fn jack_run <T> (name: &str, app: &Arc<Mutex<T>>) -> Usually<DynamicAsyncCli
|
|||
ClosureProcessHandler::new(Box::new({
|
||||
let app = app.clone();
|
||||
move|c: &Client, s: &ProcessScope|{
|
||||
app.lock().unwrap().process(c, s)
|
||||
app.write().unwrap().process(c, s)
|
||||
//Control::Continue
|
||||
}
|
||||
}) as BoxedProcessHandler)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue