全部博文(2759)
分类: Android平台
2013-09-11 12:09:18
原文地址:Android进程间共享数据的讨论 作者:beyondjdg
The pthread_mutexattr_getpshared() function obtains the value of the process-shared attribute from the attributes object referenced by attr. Thepthread_mutexattr_setpshared() function is used to set the process-shared attribute in an initialised attributes object referenced by attr.在Audio Flinger中就有这种用法,The process-shared attribute is set to PTHREAD_PROCESS_SHARED to permit a mutex to be operated upon by any thread that has access to the memory where the mutex is allocated, even if the mutex is allocated in memory that is shared by multiple processes. If the process-shared attribute is PTHREAD_PROCESS_PRIVATE, the mutex will only be operated upon by threads created within the same process as the thread that initialised the mutex; if threads of differing processes attempt to operate on such a mutex, the behaviour is undefined. The default value of the attribute is PTHREAD_PROCESS_PRIVATE.
点击(此处)折叠或打开
点击(此处)折叠或打开