Home
last modified time | relevance | path

Searched refs:lock (Results 1 – 25 of 64) sorted by relevance

123

/commonlibrary/rust/ylong_runtime/ylong_runtime/benches/
Dylong_tokio_rwlock.rs52 let lock = Arc::new(RwLock::new(())); in tokio_rwlock_read() localVariable
56 let lock = lock.clone(); in tokio_rwlock_read() localVariable
57 handlers.push(rt.spawn(tokio_rwlock_task(lock.clone()))); in tokio_rwlock_read()
77 let lock = Arc::new(YlongRwlock::new(())); in ylong_rwlock_read() localVariable
81 let lock = lock.clone(); in ylong_rwlock_read() localVariable
82 handlers.push(ylong_runtime::spawn(ylong_rwlock_task(lock.clone()))); in ylong_rwlock_read()
101 let lock = Arc::new(RwLock::new(())); in tokio_rwlock_write() localVariable
105 let lock = lock.clone(); in tokio_rwlock_write() localVariable
106 handlers.push(rt.spawn(tokio_rwlock_write_task(lock.clone()))); in tokio_rwlock_write()
126 let lock = Arc::new(YlongRwlock::new(())); in ylong_rwlock_write() localVariable
[all …]
Dylong_tokio_mutex.rs41 let mut lock = mutex1.lock().await; localVariable
42 *lock += 1;
50 let n = mutex.lock().await;
69 let mut lock = mutex1.lock().await; localVariable
70 *lock += 1;
78 let n = mutex.lock().await;
/commonlibrary/rust/ylong_runtime/ylong_runtime/src/sync/
Drwlock.rs361 let lock = RwLock::new(Test { flag: true, num: 1 }); in ut_rwlock_new_01() localVariable
362 assert!(lock.read().await.flag); in ut_rwlock_new_01()
363 assert_eq!(lock.read().await.num, 1); in ut_rwlock_new_01()
378 let lock = RwLock::new(100); in ut_rwlock_read_01() localVariable
379 let a = lock.read().await; in ut_rwlock_read_01()
394 let lock = Arc::new(RwLock::new(100)); in ut_rwlock_read_02() localVariable
395 let lock2 = lock.clone(); in ut_rwlock_read_02()
403 let a = lock.read().await; in ut_rwlock_read_02()
416 let lock = RwLock::new(100); in ut_rwlock_try_read_01() localVariable
417 let res = lock.try_read().unwrap(); in ut_rwlock_try_read_01()
[all …]
Dmutex.rs95 pub async fn lock(&self) -> MutexGuard<'_, T> { in lock() method
202 let lock = Mutex::new(10); in ut_mutex_new_01() localVariable
203 assert_eq!(lock.data.into_inner(), 10); in ut_mutex_new_01()
217 let mut lock = mutex.lock().await; in ut_mutex_lock_01() localVariable
218 *lock += 1; in ut_mutex_lock_01()
219 assert_eq!(*lock, 11); in ut_mutex_lock_01()
233 let mut lock = mutex.try_lock().unwrap(); in ut_mutex_try_lock_01() localVariable
234 *lock += 100; in ut_mutex_try_lock_01()
235 assert_eq!(*lock, 110); in ut_mutex_try_lock_01()
256 let _lock = mutex1.lock().await; in ut_mutex_try_lock_02()
[all …]
Dwake_list.rs56 let mut list = self.lock(); in insert()
63 let mut inner = self.lock(); in remove()
86 let mut inner = self.lock(); in notify()
95 pub fn lock(&self) -> Lock<'_> { in lock() method
/commonlibrary/c_utils/base/include/
Dsafe_block_queue.h60 std::unique_lock<std::mutex> lock(mutexLock_); in Push()
63 cvNotFull_.wait(lock, [&]() { return (queueT_.size() < maxSize_); }); in Push()
82 std::unique_lock<std::mutex> lock(mutexLock_); in Pop()
86 cvNotEmpty_.wait(lock, [&] { return !queueT_.empty(); }); in Pop()
107 std::unique_lock<std::mutex> lock(mutexLock_); in PushNoWait()
129 std::unique_lock<std::mutex> lock(mutexLock_); in PopNotWait()
143 std::unique_lock<std::mutex> lock(mutexLock_); in Size()
149 std::unique_lock<std::mutex> lock(mutexLock_); in IsEmpty()
155 std::unique_lock<std::mutex> lock(mutexLock_); in IsFull()
195 std::unique_lock<std::mutex> lock(mutexLock_); in Push()
[all …]
Dsafe_map.h50 std::lock_guard<std::mutex> lock(mutex_); in ReadVal()
57 std::lock_guard<std::mutex> lock(mutex_); in ChangeValueByLambda()
70 std::lock_guard<std::mutex> lock(mutex_); in Size()
86 std::lock_guard<std::mutex> lock(mutex_); in IsEmpty()
100 std::lock_guard<std::mutex> lock(mutex_); in Insert()
115 std::lock_guard<std::mutex> lock(mutex_); in EnsureInsert()
137 std::lock_guard<std::mutex> lock(mutex_); in Find()
160 std::lock_guard<std::mutex> lock(mutex_); in FindOldAndSetNew()
181 std::lock_guard<std::mutex> lock(mutex_); in Erase()
190 std::lock_guard<std::mutex> lock(mutex_); in Clear()
[all …]
Dsafe_queue.h54 std::lock_guard<std::mutex> lock(mutex_); in Erase()
60 std::lock_guard<std::mutex> lock(mutex_); in Empty()
66 std::lock_guard<std::mutex> lock(mutex_); in Push()
72 std::lock_guard<std::mutex> lock(mutex_); in Clear()
82 std::lock_guard<std::mutex> lock(mutex_); in Size()
88 std::lock_guard<std::mutex> lock(mutex_); in Pop()
/commonlibrary/rust/ylong_runtime/ylong_runtime/src/time/
Ddriver.rs76 let mut lock = self.wheel.lock().unwrap(); in timer_register() localVariable
77 lock.insert(clock_entry) in timer_register()
81 let mut lock = self.wheel.lock().unwrap(); in timer_cancel() localVariable
82 lock.cancel(clock_entry); in timer_cancel()
97 let mut lock = self.wheel.lock().unwrap(); in run() localVariable
102 match lock.poll(now) { in run()
104 let elapsed = lock.elapsed(); in run()
105 lock.set_last_elapsed(elapsed); in run()
132 drop(lock); in run()
/commonlibrary/rust/ylong_runtime/ylong_runtime/src/executor/
Dblocking_pool.rs76 let mut shared = self.inner.shared.lock().unwrap(); in shutdown()
85 let shutdown_shared = self.inner.shutdown_shared.lock().unwrap(); in shutdown()
172 let mut shared = self.inner.shared.lock().unwrap(); in create_permanent_threads()
208 let mut shared = self.inner.shared.lock().unwrap(); in spawn()
258 let mut shared = self.shared.lock().unwrap(); in run()
265 shared = self.shared.lock().unwrap(); in run()
314 shared = self.shared.lock().unwrap(); in run()
334 *self.shutdown_shared.lock().unwrap() = true; in run()
412 blocking_pool.inner.shared.lock().unwrap().shutdown = true; in ut_blocking_pool_shutdown()
419 *spawner_inner_clone.shutdown_shared.lock().unwrap() = true; in ut_blocking_pool_shutdown()
[all …]
Dcurrent_thread.rs47 let mut queue = self.inner.lock().unwrap(); in schedule()
56 let mut queue = self.inner.lock().unwrap(); in pop()
136 let mut queue = self.scheduler.inner.lock().unwrap(); in spawn()
214 let mut guard = self.mutex.lock().unwrap();
223 let mut guard = self.mutex.lock().unwrap();
299 assert_eq!(spawner.scheduler.inner.lock().unwrap().len(), 2); in ut_current_thread_spawn()
305 assert_eq!(spawner.scheduler.inner.lock().unwrap().len(), 2); in ut_current_thread_spawn()
311 assert_eq!(spawner.scheduler.inner.lock().unwrap().len(), 2); in ut_current_thread_spawn()
329 assert_eq!(spawner.scheduler.inner.lock().unwrap().len(), 2); in ut_current_thread_block_on()
335 assert_eq!(spawner.scheduler.inner.lock().unwrap().len(), 1); in ut_current_thread_block_on()
[all …]
Dasync_pool.rs337 let (lock, cvar) = &*(inner.shutdown_handle.clone()); in async_thread_proc()
338 let mut finished = lock.lock().unwrap(); in async_thread_proc()
392 self.inner.workers.lock().unwrap().push(worker.clone()); in create_async_thread_pool()
502 let (lock, cvar) = &*pair; in release_wait()
503 let finished = lock.lock().unwrap(); in release_wait()
531 let vec = self.inner.workers.lock().unwrap(); in get_worker()
690 *flag_clone.lock().unwrap() = 1; in ut_executor_mng_info_cancel()
697 assert_eq!(*flag.lock().unwrap(), 1); in ut_executor_mng_info_cancel()
720 *flag_clone.lock().unwrap() = 1; in ut_executor_mng_info_wake_up_all()
728 assert_eq!(*flag.lock().unwrap(), 1); in ut_executor_mng_info_wake_up_all()
[all …]
/commonlibrary/rust/ylong_runtime/ylong_runtime/benches/task_helpers/
Dmod.rs100 pub async fn ylong_rwlock_write_task(lock: Arc<YlongRwlock<()>>) { in ylong_rwlock_write_task()
101 let _read = lock.write().await; in ylong_rwlock_write_task()
105 pub async fn ylong_rwlock_task(lock: Arc<YlongRwlock<()>>) { in ylong_rwlock_task()
106 let _read = lock.read().await; in ylong_rwlock_task()
109 pub async fn tokio_rwlock_write_task(lock: Arc<RwLock<()>>) { in tokio_rwlock_write_task()
110 let _read = lock.write().await; in tokio_rwlock_write_task()
113 pub async fn tokio_rwlock_task(lock: Arc<RwLock<()>>) { in tokio_rwlock_task()
114 let _read = lock.read().await; in tokio_rwlock_task()
/commonlibrary/c_utils/base/src/
Dobserver.cpp28 lock_guard<mutex> lock(mutex_); in AddObserver() local
38 lock_guard<mutex> lock(mutex_); in RemoveObserver() local
44 lock_guard<mutex> lock(mutex_); in RemoveAllObservers() local
55 lock_guard<mutex> lock(mutex_); in GetObserversCount() local
68 lock_guard<mutex> lock(mutex_); in NotifyObservers() local
Dthread_pool.cpp64 std::unique_lock<std::mutex> lock(mutex_); in Stop() local
79 std::unique_lock<std::mutex> lock(mutex_); in AddTask() local
81 acceptNewTask_.wait(lock); in AddTask()
91 std::unique_lock<std::mutex> lock(mutex_); in GetCurTaskNum() local
98 std::unique_lock<std::mutex> lock(mutex_); in ScheduleTask() local
100 hasTaskToDo_.wait(lock); in ScheduleTask()
Devent_reactor.cpp65 std::lock_guard<std::recursive_mutex> lock(mutex_); in CleanUp() local
97 std::lock_guard<std::recursive_mutex> lock(mutex_); in ScheduleTimer() local
114 std::lock_guard<std::recursive_mutex> lock(mutex_); in CancelTimer() local
/commonlibrary/ets_utils/js_concurrent_module/taskpool/
Dtask_manager.cpp84 std::lock_guard<std::recursive_mutex> lock(workersMutex_); in ~TaskManager() local
92 std::unique_lock<std::shared_mutex> lock(taskInfosMutex_); in ~TaskManager() local
105 std::lock_guard<std::recursive_mutex> lock(workersMutex_); in GetThreadInfos() local
120 std::lock_guard<std::mutex> lock(worker->currentTaskIdMutex_); in GetThreadInfos() local
146 std::unique_lock<std::shared_mutex> lock(taskInfosMutex_); in GetTaskInfos() local
205 std::lock_guard<std::recursive_mutex> lock(workersMutex_); in CheckForBlockedWorkers() local
251 std::lock_guard<std::recursive_mutex> lock(workersMutex_); in CreateOrDeleteWorkers() local
348 std::unique_lock<std::shared_mutex> lock(taskEnvInfoMutex_); in StoreTaskEnvInfo() local
359 std::unique_lock<std::shared_mutex> lock(taskEnvInfoMutex_); in PopTaskEnvInfo() local
370 std::shared_lock<std::shared_mutex> lock(taskEnvInfoMutex_); in HasTaskEnvInfo() local
[all …]
/commonlibrary/rust/ylong_runtime/ylong_runtime/tests/
Dmutex.rs46 let mut lock = mutex1.lock().await; in sdv_mutex_lock_hold_longtime() localVariable
47 *lock += 1; in sdv_mutex_lock_hold_longtime()
52 let mut lock2 = mutex.lock().await; in sdv_mutex_lock_hold_longtime()
Dsync.rs73 let mut n = mutex1.lock().await; in sdv_concurrency_with_mutex1()
81 let mut n = mutex2.lock().await; in sdv_concurrency_with_mutex1()
89 let mut n = mutex3.lock().await; in sdv_concurrency_with_mutex1()
97 let mut n = mutex4.lock().await; in sdv_concurrency_with_mutex1()
105 let mut n = mutex5.lock().await; in sdv_concurrency_with_mutex1()
128 let mut n = mutex.lock().await; in sdv_concurrency_with_mutex2()
135 let n = mutex.lock().await; in sdv_concurrency_with_mutex2()
153 let mut n = m1.lock().await; in sdv_concurrency_with_mutex3()
161 if *mutex1.lock().await >= 5 { in sdv_concurrency_with_mutex3()
166 let n = mutex.lock().await; in sdv_concurrency_with_mutex3()
[all …]
Dbuilder.rs41 let mut a = xc.lock().unwrap(); in sdv_set_builder_after_start()
50 let a = x.lock().unwrap(); in sdv_set_builder_after_start()
70 let mut a = xc.lock().unwrap(); in sdv_set_builder_before_stop()
79 let a = x.lock().unwrap(); in sdv_set_builder_before_stop()
Dslab.rs191 free_queue.lock().unwrap().push((addr, test_entry, i)); in sdv_slab_multi_allocate()
199 free_queue_2.lock().unwrap().push((addr, test_entry, i)); in sdv_slab_multi_allocate()
207 free_queue_3.lock().unwrap().push((addr, test_entry, i)); in sdv_slab_multi_allocate()
223 let temp = free_queue_4.clone().lock().unwrap().pop().unwrap(); in sdv_slab_multi_allocate()
259 free_queue_one.lock().unwrap().push(addr); in sdv_slab_multi_allocate_drop()
273 free_queue_two.lock().unwrap().push(addr); in sdv_slab_multi_allocate_drop()
284 free_queue_one_2.clone().lock().unwrap().pop().unwrap(), in sdv_slab_multi_allocate_drop()
285 free_queue_two_2.lock().unwrap().pop().unwrap() in sdv_slab_multi_allocate_drop()
/commonlibrary/rust/ylong_runtime/ylong_runtime/benches/bin/
Dylong_sync_mutex_perf.rs27 let mut lock = mutex.lock().await; in main() localVariable
28 *lock += 1; in main()
/commonlibrary/memory_utils/libpurgeablemem/cpp/src/
Dpurgeable_resource_manager.cpp132 std::lock_guard<ffrt::mutex> lock(lruCacheMutex_); in ~PurgeableResourceManager() local
152 std::lock_guard<ffrt::mutex> lock(lruCacheMutex_); in BeginAccessPurgeableMem() local
182 std::lock_guard<ffrt::mutex> lock(lruCacheMutex_); in EndAccessPurgeableMem() local
226 std::lock_guard<ffrt::mutex> lock(lruCacheMutex_); in AddResourceInner() local
252 std::lock_guard<ffrt::mutex> lock(lruCacheMutex_); in RemoveResourceInner() local
264 std::lock_guard<ffrt::mutex> lock(lruCacheMutex_); in SetRecentUsedResource() local
274 std::lock_guard<ffrt::mutex> lock(lruCacheMutex_); in SetLruCacheCapacity() local
280 std::lock_guard<ffrt::mutex> lock(lruCacheMutex_); in Clear() local
286 std::lock_guard<ffrt::mutex> lock(lruCacheMutex_); in RemoveLastResource() local
307 std::lock_guard<ffrt::mutex> lock(lruCacheMutex_); in ShowLruCache() local
/commonlibrary/ets_utils/js_concurrent_module/worker/
Dmessage_queue.cpp22 queueLock_.lock(); in EnQueue()
29 queueLock_.lock(); in DeQueue()
51 queueLock_.lock(); in Clear()
/commonlibrary/rust/ylong_runtime/ylong_runtime/src/task/
Djoin_set.rs121 let mut list = entry.list.lock().unwrap(); in wake_by_ref()
179 let mut list = self.list.lock().unwrap(); in spawn_inner()
217 let count = self.list.lock().unwrap().len; in join_all()
243 let list = self.list.lock().unwrap(); in cancel_all()
285 let mut list = self.list.lock().unwrap(); in poll_join_next()
315 let mut list = self.list.lock().unwrap(); in poll_join_next()
323 let mut list = self.list.lock().unwrap(); in poll_join_next()
425 let mut list = self.list.lock().unwrap(); in drop()

123