Home
last modified time | relevance | path

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

12345678910>>...12

/frameworks/av/services/audioflinger/
DAudioFlinger.cpp640 PlaybackThread *thread = checkPlaybackThread_l(output); in createTrack() local
641 if (thread == NULL) { in createTrack()
678 track = thread->createTrack_l(client, streamType, sampleRate, format, in createTrack()
687 Mutex::Autolock _dl(thread->mLock); in createTrack()
689 moveEffectChain_l(lSessionId, effectThread, thread, true); in createTrack()
695 if (thread->isValidSyncEvent(mPendingSyncEvents[i])) { in createTrack()
707 setAudioHwSyncForSession_l(thread, lSessionId); in createTrack()
734 ThreadBase *thread = checkThread_l(ioHandle); in sampleRate() local
735 if (thread == NULL) { in sampleRate()
739 return thread->sampleRate(); in sampleRate()
[all …]
DTracks.cpp67 ThreadBase *thread, in TrackBase() argument
81 mThread(thread), in TrackBase()
102 mThreadIoHandle(thread->id()) in TrackBase()
141 const sp<MemoryDealer> roHeap(thread->readOnlyHeap()); in TrackBase()
156 mBufferMemory = thread->pipeMemory(); in TrackBase()
337 PlaybackThread *thread, in Track() argument
350 : TrackBase(thread, client, sampleRate, format, channelMask, frameCount, in Track()
360 mMainBuffer(thread->mixBuffer()), in Track()
392 mName = thread->getTrackName_l(channelMask, format, sessionId); in Track()
403 ALOG_ASSERT(thread->mFastTrackAvailMask != 0); in Track()
[all …]
DEffects.cpp58 AudioFlinger::EffectModule::EffectModule(ThreadBase *thread, in EffectModule() argument
64 mThread(thread), mChain(chain), mId(id), mSessionId(sessionId), in EffectModule()
72 mAudioFlinger(thread->mAudioFlinger) in EffectModule()
78 mStatus = EffectCreate(&desc->uuid, sessionId, thread->id(), &mEffectInterface); in EffectModule()
203 sp<ThreadBase> thread = mThread.promote(); in disconnect() local
204 if (thread != 0) { in disconnect()
205 Mutex::Autolock _l(thread->mLock); in disconnect()
206 thread->removeEffect_l(this); in disconnect()
321 sp<ThreadBase> thread; in configure() local
330 thread = mThread.promote(); in configure()
[all …]
DPatchPanel.cpp230 sp<ThreadBase> thread = in createAudioPatch() local
232 newPatch->mPlaybackThread = (MixerThread *)thread.get(); in createAudioPatch()
233 if (thread == 0) { in createAudioPatch()
298 sp<ThreadBase> thread = audioflinger->checkRecordThread_l( in createAudioPatch() local
300 if (thread == 0) { in createAudioPatch()
306 status = thread->sendCreateAudioPatchConfigEvent(patch, &halHandle); in createAudioPatch()
347 sp<ThreadBase> thread = in createAudioPatch() local
349 if (thread == 0) { in createAudioPatch()
355 if (thread == audioflinger->primaryPlaybackThread_l()) { in createAudioPatch()
362 status = thread->sendCreateAudioPatchConfigEvent(patch, &halHandle); in createAudioPatch()
[all …]
DEffects.h44 EffectModule(ThreadBase *thread,
92 void setThread(const wp<ThreadBase>& thread) { mThread = thread; } in setThread() argument
93 const wp<ThreadBase>& thread() { return mThread; } in thread() function
248 EffectChain(ThreadBase *thread, audio_session_t sessionId);
360 void clearInputBuffer_l(sp<ThreadBase> thread);
362 void setThread(const sp<ThreadBase>& thread);
/frameworks/base/docs/html-intl/intl/in/guide/components/
Dprocesses-and-threads.jd19 <li><a href="#ThreadSafe">Metode thread-safe</a></li>
29 berjalan, sistem Android akan memulai proses Linux baru untuk aplikasi dengan satu thread
31 thread yang sama (disebut thread "utama"). Jika komponen aplikasi dimulai dan sudah ada
33 akan dimulai dalam proses itu dan menggunakan thread eksekusi yang sama. Akan tetapi, Anda bisa
34 … berbeda di aplikasi agar berjalan di proses terpisah, dan Anda bisa membuat thread tambahan untuk
37 <p>Dokumen ini membahas cara kerja proses dan thread di aplikasi Android.</p>
179 membuat thread pekerja&mdash;khususnya jika operasi mungkin akan berlangsung lebih lama daripada ak…
184 menjalankan layanan daripada hanya menempatkan operasi yang menghabiskan waktu di thread.</p>
191 <p>Bila aplikasi diluncurkan, sistem akan membuat thread eksekusi untuk aplikasi tersebut, yang dib…
193 antarmuka pengguna yang sesuai, termasuk kejadian menggambar. Ini juga merupakan thread yang
[all …]
/frameworks/base/docs/html/training/multiple-threads/
Drun-code.jd32 The previous lesson showed you how to define a class that manages thread pools and the tasks
33 that run on them. This lesson shows you how to run a task on a thread pool. To do this,
34 you add the task to the pool's work queue. When a thread becomes available, the
36 thread.
41 time, you can cancel the thread the task is running on. For example, if you are downloading
48 To start a task object on a thread in a particular thread pool, pass the
50 ThreadPoolExecutor.execute()}. This call adds the task to the thread pool's work queue. When an
51 idle thread becomes available, the manager takes the task that has been waiting the longest and
52 runs it on the thread:
72 thread, it automatically calls the object's {@link java.lang.Runnable#run run()} method.
[all …]
Dcommunicate-ui.jd31 In the previous lesson you learned how to start a task on a thread managed by
33 from the task to objects running on the user interface (UI) thread. This feature allows your
37 Every app has its own special thread that runs UI objects such as {@link android.view.View}
38 objects; this thread is called the UI thread. Only objects running on the UI thread have access
39 to other objects on that thread. Because tasks that you run on a thread from a thread pool
40 <em>aren't</em> running on your UI thread, they don't have access to UI objects. To move data
41 from a background thread to the UI thread, use a {@link android.os.Handler} that's
42 running on the UI thread.
48 Normally, you create a {@link android.os.Handler} for a new thread, but you can
49 also create a {@link android.os.Handler} that's connected to an existing thread.
[all …]
Dcreate-threadpool.jd35 separate thread. If you only want to run the task once, this may be all you need. If you want
40 {@link java.util.concurrent.ThreadPoolExecutor}, which runs a task from a queue when a thread
44 A thread pool can run multiple parallel instances of a task, so you should ensure that your
45 code is thread-safe. Enclose variables that can be accessed by more than one thread in a
46 <code>synchronized</code> block. This approach will prevent one thread from reading the variable
60 Use static variables for thread pools
63 You may only want a single instance of a thread pool for your app, in order to have a
65 {@link java.lang.Runnable} types, you may want to have a thread pool for each one, but each
89 * Constructs the work queues and thread pools used to download
99 Start your tasks by calling methods in the thread pool class.
[all …]
Dindex.jd47 separate thread.
51 thread pool object. You'll also learn how to define code to run on a thread and how to
52 communicate between one of these threads and the UI thread.
75 Learn how to run a {@link java.lang.Runnable} on a thread from the thread pool.
81 Learn how to communicate from a thread in the thread pool to the UI thread.
Ddefine-runnable.jd34 in its {@link java.lang.Runnable#run Runnable.run()} method on a separate thread. You can also
35 pass a {@link java.lang.Runnable} to another object that can then attach it to a thread and
57 * Code you want to run on the thread goes here
68 though, that the {@link java.lang.Runnable} won't be running on the UI thread, so it can't
70 the UI thread, you have to use the techniques described in the lesson
74 At the beginning of the {@link java.lang.Runnable#run run()} method, set the thread to use
78 resource competition between the {@link java.lang.Runnable} object's thread and the UI
79 thread.
/frameworks/base/libs/hwui/renderthread/
DRenderProxy.cpp56 CREATE_BRIDGE4(createContext, RenderThread* thread, bool translucent, in CREATE_BRIDGE4() argument
58 return new CanvasContext(*args->thread, args->translucent, in CREATE_BRIDGE4()
68 args->thread = &mRenderThread; in RenderProxy()
249 CREATE_BRIDGE2(invokeFunctor, RenderThread* thread, Functor* functor) { in CREATE_BRIDGE2() argument
250 CanvasContext::invokeFunctor(*args->thread, args->functor); in CREATE_BRIDGE2()
256 RenderThread& thread = RenderThread::getInstance(); in invokeFunctor() local
258 args->thread = &thread; in invokeFunctor()
266 thread.queue(task); in invokeFunctor()
354 CREATE_BRIDGE2(trimMemory, RenderThread* thread, int level) { in CREATE_BRIDGE2() argument
355 CanvasContext::trimMemory(*args->thread, args->level); in CREATE_BRIDGE2()
[all …]
DCanvasContext.cpp64 CanvasContext::CanvasContext(RenderThread& thread, bool translucent, in CanvasContext() argument
66 : mRenderThread(thread) in CanvasContext()
67 , mEglManager(thread.eglManager()) in CanvasContext()
70 , mJankTracker(thread.timeLord().frameIntervalNanos()) in CanvasContext()
577 void CanvasContext::invokeFunctor(RenderThread& thread, Functor* functor) { in invokeFunctor() argument
580 if (thread.eglManager().hasEglContext()) { in invokeFunctor()
584 thread.renderState().invokeFunctor(functor, mode, nullptr); in invokeFunctor()
669 void CanvasContext::trimMemory(RenderThread& thread, int level) { in trimMemory() argument
671 if (!thread.eglManager().hasEglContext()) return; in trimMemory()
675 thread.renderState().flush(Caches::FlushMode::Full); in trimMemory()
[all …]
/frameworks/base/docs/html/training/articles/
Dperf-anr.jd47 (frequently a network access) on the UI thread so the system can't
50 structure or computing the next move in a game on the UI thread. It's always important to make
55 <strong>you should not perform the work on the UI thread</strong>, but instead create a
56 worker thread and do most of the work there. This keeps the UI thread (which drives the user
78 <p>Android applications normally run entirely on a single thread by default
79 the "UI thread" or "main thread").
80 This means anything your application is doing in the UI thread that
85 <p>Therefore, any method that runs in the UI thread should do as little work
86 as possible on that thread. In particular, activities should do as little as possible to set
91 resizing bitmaps should be done in a worker thread (or in the case of databases
[all …]
/frameworks/base/docs/html/guide/components/
Dprocesses-and-threads.jd29 running, the Android system starts a new Linux process for the application with a single thread of
30 execution. By default, all components of the same application run in the same process and thread
31 (called the "main" thread). If an application component starts and there already exists a process
33 started within that process and uses the same thread of execution. However, you can arrange for
182 simply create a worker thread&mdash;particularly if the operation will likely outlast the activity.
187 employ services rather than simply put time-consuming operations in a thread.</p>
194 <p>When an application is launched, the system creates a thread of execution for the application,
195 called "main." This thread is very important because it is in charge of dispatching events to
196 the appropriate user interface widgets, including drawing events. It is also the thread in which
198 android.widget} and {@link android.view} packages). As such, the main thread is also sometimes
[all …]
/frameworks/opt/telephony/src/java/com/google/android/mms/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()
232 HashSet<Uri> thread = mThreads.get(entry.getThreadId()); in removeFromThreads() local
233 if (thread != null) { in removeFromThreads()
234 thread.remove(key); in removeFromThreads()
243 HashSet<Uri> thread = mThreads.remove(threadId); in purgeByThreadId() local
244 if (thread != null) { in purgeByThreadId()
[all …]
/frameworks/base/core/tests/coretests/src/android/content/
DContentQueryMapTest.java56 LooperThread thread = new LooperThread() { in testContentQueryMap() local
101 thread.start(); in testContentQueryMap()
102 thread.join(); in testContentQueryMap()
103 if (thread.mError != null) throw thread.mError; in testContentQueryMap()
104 assertTrue(thread.mSuccess); in testContentQueryMap()
/frameworks/av/media/libstagefright/foundation/
DALooper.cpp133 sp<LooperThread> thread; in stop() local
139 thread = mThread; in stop()
145 if (thread == NULL && !runningLocally) { in stop()
149 if (thread != NULL) { in stop()
150 thread->requestExit(); in stop()
159 if (!runningLocally && !thread->isCurrentThread()) { in stop()
162 thread->requestExitAndWait(); in stop()
/frameworks/base/libs/hwui/tests/microbench/
DFrameBuilderBench.cpp62 TestUtils::runOnRenderThread([&state](RenderThread& thread) { in BM_FrameBuilder_defer() argument
75 TestUtils::runOnRenderThread([&state](RenderThread& thread) { in BM_FrameBuilder_deferAndRender() argument
78 RenderState& renderState = thread.renderState(); in BM_FrameBuilder_deferAndRender()
115 TestUtils::runOnRenderThread([&state](RenderThread& thread) { in BM_FrameBuilder_defer_scene() argument
131 TestUtils::runOnRenderThread([&state](RenderThread& thread) { in BM_FrameBuilder_deferAndRender_scene() argument
136 RenderState& renderState = thread.renderState(); in BM_FrameBuilder_deferAndRender_scene()
/frameworks/base/docs/html/training/improving-layouts/
Dsmooth-scrolling.jd33 thread (the UI thread) free from heavy processing. Ensure you do any disk access, network access, or
34 SQL access in a separate thread. To test the status of your app, you can enable {@link
40 <p>Using a background thread ("worker thread") removes strain from the main thread so it can focus
42 perform your work outside the main thread. {@link android.os.AsyncTask} automatically queues up all
45 own thread pool.</p>
48 images in a background thread, then apply them to the UI once finished. It also shows a
52 // Using an AsyncTask to load the slow images in a background thread
/frameworks/opt/bitmap/src/com/android/bitmap/
DNamedThreadFactory.java35 final Thread thread = mDefaultThreadFactory.newThread(runnable); in newThread() local
36 thread.setName(mBaseName + "-" + mCount.getAndIncrement()); in newThread()
37 return thread; in newThread()
/frameworks/volley/src/main/java/com/android/volley/
DVolleyLog.java116 public final long thread; field in VolleyLog.MarkerLog.Marker
119 public Marker(String name, long thread, long time) { in Marker() argument
121 this.thread = thread; in Marker()
155 d("(+%-4d) [%2d] %s", (thisTime - prevTime), marker.thread, marker.name); in finish()
/frameworks/base/core/tests/coretests/src/android/database/
DDatabaseLockTest.java93 Thread thread = new DatabaseFairnessThread(); in startDatabaseFairnessThread() local
94 thread.start(); in startDatabaseFairnessThread()
150 Thread thread = new DatabaseLatencyThread(); in startDatabaseLatencyThread() local
151 thread.start(); in startDatabaseLatencyThread()
/frameworks/base/docs/html/training/volley/
Dsimple.jd33 back to the main thread for delivery.</p>
82 <p>Volley always delivers parsed responses on the main thread. Running on the main thread
98 <p>When you call {@code add()}, Volley runs one cache processing thread and a pool of
100 thread and triaged: if the request can be serviced from cache, the cached response is
101 parsed on the cache thread and the parsed response is delivered on the main thread. If the
103 available network thread takes the request from the queue, performs the HTTP transaction,
104 parses the response on the worker thread, writes the response to cache, and posts the parsed
105 response back to the main thread for delivery.</p>
108 threads. You can add a request from any thread, but responses are always delivered on the
109 main thread.</p>
/frameworks/base/core/java/android/app/
DIntentService.java109 HandlerThread thread = new HandlerThread("IntentService[" + mName + "]"); in onCreate() local
110 thread.start(); in onCreate()
112 mServiceLooper = thread.getLooper(); in onCreate()

12345678910>>...12