Home
last modified time | relevance | path

Searched refs:thread (Results 1 – 25 of 284) sorted by relevance

12345678910>>...12

/packages/modules/Bluetooth/system/osi/src/
Dthread.cc53 thread_t* thread; member
86 start.thread = ret; in thread_new_sized()
109 void thread_free(thread_t* thread) { in thread_free() argument
110 if (!thread) return; in thread_free()
112 thread_stop(thread); in thread_free()
113 thread_join(thread); in thread_free()
115 fixed_queue_free(thread->work_queue, osi_free); in thread_free()
116 reactor_free(thread->reactor); in thread_free()
117 osi_free(thread); in thread_free()
120 void thread_join(thread_t* thread) { in thread_join() argument
[all …]
/packages/modules/Bluetooth/system/test/mock/
Dmock_osi_thread.h69 std::function<void(thread_t* thread)> body{[](thread_t* thread) {}};
70 void operator()(thread_t* thread) { body(thread); }; in operator()
79 std::function<reactor_t*(const thread_t* thread)> body{
80 [this](const thread_t* thread) { return return_value; }};
81 reactor_t* operator()(const thread_t* thread) { return body(thread); }; in operator()
90 std::function<bool(const thread_t* thread)> body{
91 [this](const thread_t* thread) { return return_value; }};
92 bool operator()(const thread_t* thread) { return body(thread); }; in operator()
100 std::function<void(thread_t* thread)> body{[](thread_t* thread) {}};
101 void operator()(thread_t* thread) { body(thread); }; in operator()
[all …]
Dmock_osi_thread.cc58 void thread_free(thread_t* thread) { in thread_free() argument
60 test::mock::osi_thread::thread_free(thread); in thread_free()
62 reactor_t* thread_get_reactor(const thread_t* thread) { in thread_get_reactor() argument
64 return test::mock::osi_thread::thread_get_reactor(thread); in thread_get_reactor()
66 bool thread_is_self(const thread_t* thread) { in thread_is_self() argument
68 return test::mock::osi_thread::thread_is_self(thread); in thread_is_self()
70 void thread_join(thread_t* thread) { in thread_join() argument
72 test::mock::osi_thread::thread_join(thread); in thread_join()
74 const char* thread_name(const thread_t* thread) { in thread_name() argument
76 return test::mock::osi_thread::thread_name(thread); in thread_name()
[all …]
/packages/modules/Bluetooth/system/osi/test/
Dthread_test.cc14 thread_t* thread = thread_new("test_thread"); in TEST_F() local
15 ASSERT_TRUE(thread != NULL); in TEST_F()
16 thread_free(thread); in TEST_F()
20 thread_t* thread = thread_new("test_thread"); in TEST_F() local
21 thread_free(thread); in TEST_F()
25 thread_t* thread = thread_new("test_name"); in TEST_F() local
26 ASSERT_STREQ(thread_name(thread), "test_name"); in TEST_F()
27 thread_free(thread); in TEST_F()
31 thread_t* thread = thread_new("0123456789abcdef"); in TEST_F() local
32 ASSERT_STREQ("0123456789abcdef", thread_name(thread)); in TEST_F()
[all …]
Dsemaphore_test.cc76 MessageLoopThread thread("semaphore_test_thread"); in TEST_F() local
77 thread.StartUp(); in TEST_F()
78 ASSERT_TRUE(thread.IsRunning()); in TEST_F()
82 thread.DoInThread(FROM_HERE, in TEST_F()
89 thread.ShutDown(); in TEST_F()
/packages/apps/Gallery2/src/com/android/gallery3d/util/
DProfile.java42 Thread thread; field in Profile.WatchEntry
77 public synchronized void addWatchEntry(Thread thread, int cycleTime) { in addWatchEntry() argument
79 e.thread = thread; in addWatchEntry()
87 public synchronized void removeWatchEntry(Thread thread) { in removeWatchEntry() argument
89 if (mList.get(i).thread == thread) { in removeWatchEntry()
112 Thread thread = entry.thread; in processList() local
126 Thread thread = entry.thread; in sampleStack() local
127 StackTraceElement[] stack = thread.getStackTrace(); in sampleStack()
139 private WatchEntry findEntry(Thread thread) { in findEntry() argument
142 if (entry.thread == thread) return entry; in findEntry()
/packages/modules/Bluetooth/system/gd/os/linux_generic/
Dthread_unittest.cc33 …explicit SampleReactable(Thread* thread) : thread_(thread), fd_(eventfd(0, 0)), is_same_thread_che… in SampleReactable() argument
60 thread = new Thread("test", Thread::Priority::NORMAL); in SetUp()
64 delete thread; in TearDown()
66 Thread* thread = nullptr; member in bluetooth::os::__anon40e447eb0111::ThreadTest
70 thread->Stop(); in TEST_F()
74 EXPECT_EQ(thread->GetThreadName(), "test"); in TEST_F()
78 EXPECT_NE(thread->ToString().find("test"), std::string::npos); in TEST_F()
82 EXPECT_FALSE(thread->IsSameThread()); in TEST_F()
86 Reactor* reactor = thread->GetReactor(); in TEST_F()
87 SampleReactable sample_reactable(thread); in TEST_F()
Dreactor_unittest.cc169 auto reactor_thread = std::thread(&Reactor::Run, reactor_); in TEST_F()
175 auto reactor_thread = std::thread(&Reactor::Stop, reactor_); in TEST_F()
176 auto another_thread = std::thread(&Reactor::Run, reactor_); in TEST_F()
182 auto reactor_thread = std::thread(&Reactor::Run, reactor_); in TEST_F()
201 auto reactor_thread = std::thread(&Reactor::Run, reactor_); in TEST_F()
213 auto reactor_thread = std::thread(&Reactor::Run, reactor_); in TEST_F()
234 auto reactor_thread = std::thread(&Reactor::Run, reactor_); in TEST_F()
252 auto reactor_thread = std::thread(&Reactor::Run, reactor_); in TEST_F()
271 auto reactor_thread = std::thread(&Reactor::Run, reactor_); in TEST_F()
288 auto reactor_thread = std::thread(&Reactor::Run, reactor_); in TEST_F()
[all …]
/packages/modules/Bluetooth/system/osi/include/
Dthread.h44 void thread_free(thread_t* thread);
49 void thread_join(thread_t* thread);
56 bool thread_post(thread_t* thread, thread_fn func, void* context);
61 void thread_stop(thread_t* thread);
66 bool thread_set_priority(thread_t* thread, int priority);
73 bool thread_set_rt_priority(thread_t* thread, int priority);
78 bool thread_is_self(const thread_t* thread);
81 reactor_t* thread_get_reactor(const thread_t* thread);
84 const char* thread_name(const thread_t* thread);
/packages/apps/Camera2/src/com/android/camera/async/
DHandlerFactory.java32 final HandlerThread thread = new HandlerThread(threadName); in create() local
33 thread.start(); in create()
38 thread.quitSafely(); in create()
42 return new Handler(thread.getLooper()); in create()
52 final HandlerThread thread = new HandlerThread(threadName); in create() local
53 thread.start(); in create()
54 thread.setPriority(javaThreadPriority); in create()
59 thread.quitSafely(); in create()
63 return new Handler(thread.getLooper()); in create()
/packages/apps/Dialer/java/com/android/dialer/common/concurrent/
DDialerExecutorModule.java63 Thread thread = new Thread(runnable, "DialerExecutors-LowPriority"); in provideNonUiThreadPool()
65 thread.setPriority(4); in provideNonUiThreadPool()
66 return thread; in provideNonUiThreadPool()
80 Thread thread = new Thread(runnable, "DialerExecutors-LowPriority-Serial");
82 thread.setPriority(4);
83 return thread;
103 Thread thread = new Thread(runnable, "DialerExecutors-HighPriority-Serial");
105 thread.setPriority(5);
106 return thread;
/packages/modules/Bluetooth/system/gd/docs/architecture/
Darchitecture.md54 Currently, the goals of thread optimization in the Bluetooth stack are:
59 methods to interact with it on main thread
61 alarm thread
63 stopped individually without terminating the main thread
70 **Main thread**
71 : The main workhorse in the Bluetooth stack. The thread's execution context is
73 [`Modules`](#module). This thread can be divided further into smaller ones
78 **JNI thread**
79 : In the native thread, we treat the Java layer as a separate application as
80 its threading module is completely different. Therefore, we put a thread
[all …]
/packages/providers/DownloadProvider/src/com/android/providers/downloads/
DDownloadJobService.java67 final DownloadThread thread; in onStartJob() local
73 thread = new DownloadThread(this, params, info); in onStartJob()
74 mActiveThreads.put(id, thread); in onStartJob()
76 thread.start(); in onStartJob()
86 final DownloadThread thread; in onStopJob() local
88 thread = mActiveThreads.removeReturnOld(id); in onStopJob()
90 if (thread != null) { in onStopJob()
93 thread.requestShutdown(); in onStopJob()
/packages/modules/Bluetooth/system/common/
Dmessage_loop_thread_unittest.cc289 base::BindOnce([](MessageLoopThread* thread) { thread->IsRunning(); }, in TEST_F() argument
299 auto thread = std::thread(&MessageLoopThread::ShutDown, &message_loop_thread); in TEST_F() local
301 thread.join(); in TEST_F()
309 auto thread = std::thread(&MessageLoopThread::StartUp, &message_loop_thread); in TEST_F() local
310 thread.join(); in TEST_F()
318 auto thread = std::thread(&MessageLoopThread::ShutDown, &message_loop_thread); in TEST_F() local
319 thread.join(); in TEST_F()
328 auto thread = std::thread(&MessageLoopThread::StartUp, &message_loop_thread); in TEST_F() local
329 thread.join(); in TEST_F()
/packages/services/Car/tests/carservice_unit_test/src/android/car/test/mocks/
DJavaMockitoHelperTest.java139 Thread thread = getCurrentThreadIninterrupted(); in testGetResult_interruptedException() local
146 assertWithMessage("thread %s interrupted ", thread).that(thread.isInterrupted()).isTrue(); in testGetResult_interruptedException()
200 Thread thread = getCurrentThreadIninterrupted(); in testGetResult_withCustomTimeout_interruptedException() local
207 assertWithMessage("thread %s interrupted ", thread).that(thread.isInterrupted()).isTrue(); in testGetResult_withCustomTimeout_interruptedException()
211 Thread thread = Thread.currentThread(); in getCurrentThreadIninterrupted() local
213 Log.w(TAG, "Thread " + thread + " was not interrupted"); in getCurrentThreadIninterrupted()
215 if (!thread.isInterrupted()) { in getCurrentThreadIninterrupted()
216 throw new IllegalStateException("Could not reset interrupted state of " + thread); in getCurrentThreadIninterrupted()
219 return thread; in getCurrentThreadIninterrupted()
/packages/apps/Messaging/src/com/android/messaging/mmslib/util/
DPduCache.java104 HashSet<Uri> thread = mThreads.get(threadId); in put() local
105 if (thread == null) { in put()
106 thread = new HashSet<Uri>(); in put()
107 mThreads.put(threadId, thread); in put()
114 thread.add(finalKey); in put()
233 HashSet<Uri> thread = mThreads.get(entry.getThreadId()); in removeFromThreads() local
234 if (thread != null) { in removeFromThreads()
235 thread.remove(key); in removeFromThreads()
244 HashSet<Uri> thread = mThreads.remove(threadId); in purgeByThreadId() local
245 if (thread != null) { in purgeByThreadId()
[all …]
/packages/modules/DnsResolver/tests/
Dresolv_stress_test.cpp53 std::vector<std::thread> threads(num_threads); in RunGetAddrInfoStressTest()
54 for (std::thread& thread : threads) { in RunGetAddrInfoStressTest()
55 thread = std::thread([&mappings, num_queries]() { in RunGetAddrInfoStressTest()
76 for (std::thread& thread : threads) { in RunGetAddrInfoStressTest()
77 thread.join(); in RunGetAddrInfoStressTest()
Dresolv_cache_unit_test.cpp456 std::vector<std::thread> threads(5); in TEST_F()
457 for (std::thread& thread : threads) { in TEST_F()
458 thread = std::thread([&]() { in TEST_F()
486 for (std::thread& thread : threads) { in TEST_F()
487 thread.join(); in TEST_F()
499 std::vector<std::thread> threads(5); in TEST_F()
500 for (std::thread& thread : threads) { in TEST_F()
501 thread = std::thread([&]() { in TEST_F()
516 for (std::thread& thread : threads) { in TEST_F()
517 thread.join(); in TEST_F()
[all …]
/packages/modules/Bluetooth/system/gd/rust/shim/src/
Dmessage_loop_thread.rs23 fn main_message_loop_thread_start(thread: &mut MessageLoopThread) -> i32; in main_message_loop_thread_start()
25 thread: &mut MessageLoopThread, in main_message_loop_thread_do_delayed()
53 pub fn main_message_loop_thread_start(thread: &mut MessageLoopThread) -> i32 { in main_message_loop_thread_start()
56 thread.rt.block_on(async move { nix::unistd::gettid().as_raw() }) in main_message_loop_thread_start()
60 thread: &mut MessageLoopThread, in main_message_loop_thread_do_delayed()
66 if thread.tx.send(closure).is_err() { in main_message_loop_thread_do_delayed()
70 thread.rt.spawn(async move { in main_message_loop_thread_do_delayed()
/packages/modules/DnsResolver/
DREADME-DoT.md15 network. `DnsTlsDispatcher` also blocks each query thread, waiting on a
20 `DnsTlsSocket`, which happen on a different thread.
37 For clarity, each of the five classes in this design is thread-safe and holds one lock.
38 Classes that spawn a helper thread call `thread::join()` in their destructor to ensure
41 All the classes here make full use of Clang thread annotations (and also null-pointer
45 This code creates O(1) threads per socket, and does not create a new thread for each
46 query or response. However, DnsProxyListener does create a thread for each query.
50 `DnsTlsSocket` can receive queries on any thread, and send them over a
53 from its thread, and the loop thread (which owns the SSL socket)
55 instead, any queueing happens by blocking the query thread until the
[all …]
/packages/apps/TV/common/src/com/android/tv/common/concurrent/
DNamedThreadFactory.java37 final Thread thread = mDefaultThreadFactory.newThread(runnable); in newThread() local
38 thread.setName(mPrefix + mCount.getAndIncrement()); in newThread()
39 return thread; in newThread()
42 public boolean namedWithPrefix(Thread thread) { in namedWithPrefix() argument
43 return thread.getName().startsWith(mPrefix); in namedWithPrefix()
/packages/modules/Bluetooth/android/pandora/mmi2grpc/mmi2grpc/
D_audio.py60 self.thread = None
64 self.thread = Thread(target=self._run)
65 self.thread.start()
87 assert self.thread is not None
88 self.thread.join()
89 self.thread = None
/packages/modules/adb/daemon/
Dproperty_monitor_test.cpp49 static std::thread SpawnThread(PropertyMonitor* pm) { in SpawnThread()
50 return std::thread([pm]() { in SpawnThread()
87 auto thread = SpawnThread(&pm); in TEST() local
90 thread.join(); in TEST()
111 auto thread = SpawnThread(&pm); in TEST() local
135 thread.join(); in TEST()
153 auto thread = SpawnThread(&pm); in TEST() local
189 thread.join(); in TEST()
/packages/modules/Bluetooth/system/btif/src/
Dbtif_sock.cc64 static thread_t* thread; variable
94 CHECK(thread == NULL); in btif_sock_init()
116 thread = thread_new("btif_sock"); in btif_sock_init()
117 if (!thread) { in btif_sock_init()
123 status = btsock_sco_init(thread); in btif_sock_init()
133 thread_free(thread); in btif_sock_init()
134 thread = NULL; in btif_sock_init()
149 thread_free(thread); in btif_sock_cleanup()
150 thread = NULL; in btif_sock_cleanup()
/packages/modules/Bluetooth/system/gd/
Dmodule.cc68 void ModuleRegistry::Start(ModuleList* modules, Thread* thread) { in Start() argument
70 Start(*it, thread); in Start()
74 void ModuleRegistry::set_registry_and_handler(Module* instance, Thread* thread) const { in set_registry_and_handler()
76 instance->handler_ = new Handler(thread); in set_registry_and_handler()
79 Module* ModuleRegistry::Start(const ModuleFactory* module, Thread* thread) { in Start() argument
88 set_registry_and_handler(instance, thread); in Start()
92 Start(&instance->dependencies_, thread); in Start()

12345678910>>...12