Home
last modified time | relevance | path

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

123

/ohos5.0/docs/en/device-dev/kernel/
H A Dkernel-mini-basic-ipc-sem.md10 - **0**: The semaphore is unavailable. In this case, tasks waiting for the semaphore may exist.
12 - Positive number: The semaphore is available.
45 Creating a semaphore: Obtain a semaphore from the linked list for unused semaphores and set its ini…
56 ![](figures/semaphore-working-mechanism-for-mini-systems.png "semaphore-working-mechanism-for-mini-…
63semaphore| **LOS_SemCreate**: creates a semaphore and returns the semaphore ID.<br>**LOS_BinarySem…
64 …g or releasing a semaphore| **LOS_SemPend**: requests a semaphore and sets the timeout period.<br>…
69 1. Call **LOS_SemCreate** to create a semaphore. To create a binary semaphore, call **LOS_BinarySem…
120 /* The semaphore is acquired. */
154 /* Release the semaphore. */
167 /* Create a semaphore. */
[all …]
H A Dkernel-small-basic-trans-semaphore.md10 - **0**: The semaphore is unavailable. In this case, tasks waiting for the semaphore may exist.
14 The semaphore used for exclusive access to resources is different from the semaphore used for synch…
49 …Obtain a semaphore from the linked list of unused semaphores and assign an initial value to the se…
79 | LOS_SemCreate | Creates a semaphore and returns the semaphore ID.|
81 | LOS_SemDelete | Deletes a semaphore.|
88 | LOS_SemPost | Releases a semaphore.|
93 1. Call **LOS_SemCreate** to create a semaphore. To create a binary semaphore, call **LOS_BinarySem…
152 /* The semaphore is acquired. */
187 /* Release the semaphore. */
198 /* Create a semaphore. */
[all …]
H A Dkernel-small-debug-shell-cmd-sem.md20 | ID | Specifies the semaphore ID.| [0, 1023] or [0x0, 0x3FF]|
26 …rameter is specified, this command displays the semaphore IDs and the number of times that each se…
28 - If **ID** is specified, the use of the specified semaphore is displayed.
43 Example 1: brief semaphore information
75 | Count | Number of times that the semaphore is used.|
80 …*ID** is a value within [0, 1023], semaphore information of the specified ID is displayed. If the …
82 Example 2: detailed semaphore information
121 | Count | Number of times that the semaphore is used.|
122 | OriginalCount | Original count of the semaphore.|
123 | Creator | Address of the entry function of the thread used to create the semaphore.|
[all …]
H A Dkernel-mini-appx-lib.md109 **Table 8** APIs for semaphore management
114 | osSemaphoreDelete | Deletes a semaphore.|
115 | osSemaphoreGetCount | Obtains the token count of the current semaphore.|
116 | osSemaphoreGetName | Obtains the name of a semaphore (not implemented yet).|
117 | osSemaphoreNew | Creates and initializes a semaphore.|
118 | osSemaphoreRelease | Releases semaphore tokens till the initial maximum count.|
381 | \#include &lt;semaphore.h&gt; | int sem_timedwait(sem_t \*sem, const struct timespec \*abs_timeou…
382 | \#include &lt;semaphore.h&gt; | int sem_destroy(sem_t \*sem); | Destroys the specified unnamed se…
383 …\#include &lt;semaphore.h&gt; | int sem_init(sem_t \*sem, int pshared, unsigned int value); | Crea…
384 | \#include &lt;semaphore.h&gt; | int sem_post(sem_t \*sem); | Increments the semaphore count by 1.|
[all …]
/ohos5.0/foundation/graphic/graphic_3d/lume/LumeRender/src/vulkan/
H A Dgpu_semaphore_vk.cpp41 &plat_.semaphore)); // pSemaphore in RENDER_BEGIN_NAMESPACE()
49 plat_.semaphore = VulkanHandleCast<VkSemaphore>(handle); in GpuSemaphoreVk()
55 if (ownsResources_ && plat_.semaphore) { in ~GpuSemaphoreVk()
59 plat_.semaphore, // semaphore in ~GpuSemaphoreVk()
62 plat_.semaphore = VK_NULL_HANDLE; in ~GpuSemaphoreVk()
67 return VulkanHandleCast<uint64_t>(plat_.semaphore); in GetHandle()
H A Dgpu_semaphore_vk.h30 VkSemaphore semaphore { VK_NULL_HANDLE };
/ohos5.0/foundation/graphic/graphic_2d/rosen/modules/render_service_base/src/platform/ohos/backend/
H A Drs_surface_ohos_vulkan.cpp125 semaphore = VK_NULL_HANDLE; in CreateVkSemaphore()
133 importSemaphoreFdInfo.semaphore = semaphore; in CreateVkSemaphore()
140 vkInterface.vkDestroySemaphore(vkInterface.GetDevice(), semaphore, nullptr); in CreateVkSemaphore()
141 semaphore = VK_NULL_HANDLE; in CreateVkSemaphore()
215 VkSemaphore semaphore = VK_NULL_HANDLE; in RequestFrame() local
216 CreateVkSemaphore(semaphore, vkContext, nativeSurface); in RequestFrame()
217 if (semaphore != VK_NULL_HANDLE) { in RequestFrame()
218 nativeSurface.drawingSurface->Wait(1, semaphore); in RequestFrame()
254 VkSemaphore semaphore = vkContext.RequireSemaphore(); in FlushFrame() local
257 backendSemaphore.initVulkan(semaphore); in FlushFrame()
[all …]
H A Drs_vulkan_context.cpp95 vkDestroySemaphore(device_, semaphoreFence.semaphore, nullptr); in ~RsVulkanInterface()
475 vkDestroySemaphore(device_, semaphoreFence.semaphore, nullptr); in DestroyAllSemaphoreFence()
491 vkDestroySemaphore(device_, semaphoreFence.semaphore, nullptr); in RequireSemaphore()
498 vkDestroySemaphore(device_, it->semaphore, nullptr); in RequireSemaphore()
499 it->semaphore = VK_NULL_HANDLE; in RequireSemaphore()
511 VkSemaphore semaphore; in RequireSemaphore() local
512 auto err = vkCreateSemaphore(device_, &semaphoreInfo, nullptr, &semaphore); in RequireSemaphore()
516 return semaphore; in RequireSemaphore()
519 void RsVulkanInterface::SendSemaphoreWithFd(VkSemaphore semaphore, int fenceFd) in SendSemaphoreWithFd() argument
523 semaphoreFence.semaphore = semaphore; in SendSemaphoreWithFd()
H A Drs_surface_ohos_vulkan.h42 VkSemaphore semaphore) in DestroySemaphoreInfo()
43 : mDestroyFunction(destroyFunction), mDevice(device), mSemaphore(semaphore) {} in DestroySemaphoreInfo()
105 void CreateVkSemaphore(VkSemaphore& semaphore,
H A Drs_vulkan_context.h48 CallbackSemaphoreInfo(RsVulkanInterface& vkContext, VkSemaphore semaphore, int fenceFd) in CallbackSemaphoreInfo()
50 mSemaphore(semaphore), in CallbackSemaphoreInfo()
216 void SendSemaphoreWithFd(VkSemaphore semaphore, int fenceFd);
261 VkSemaphore semaphore; member
/ohos5.0/foundation/graphic/graphic_2d/rosen/samples/2d_graphics/drawing_engine/drawing_surface/
H A Dsurface_ohos_vulkan.cpp132 …VkSemaphore* semaphore, RsVulkanContext& vkContext, NativeBufferUtils::NativeSurfaceInfo& nativeSu… in CreateVkSemaphore() argument
139 rsInterface.vkCreateSemaphore(rsInterface.GetDevice(), &semaphoreInfo, nullptr, semaphore); in CreateVkSemaphore()
144 importSemaphoreFdInfo.semaphore = *semaphore; in CreateVkSemaphore()
217 VkSemaphore semaphore; in NativeRequestFrame() local
218 CreateVkSemaphore(&semaphore, vkContext, nativeSurface); in NativeRequestFrame()
219 nativeSurface.drawingSurface->Wait(1, semaphore); in NativeRequestFrame()
279 VkSemaphore semaphore; in NativeFlushFrame() local
280 vkContext.vkCreateSemaphore(vkContext.GetDevice(), &semaphoreInfo, nullptr, &semaphore); in NativeFlushFrame()
283 backendSemaphore.initVulkan(semaphore); in NativeFlushFrame()
304 queue, 1, &semaphore, surface.image, &fenceFd); in NativeFlushFrame()
[all …]
/ohos5.0/foundation/communication/bluetooth_service/services/bluetooth/stack/platform/linux/
H A Dsemaphore_linux.c49 Semaphore *semaphore = (Semaphore *)malloc(sizeof(Semaphore)); in SemaphoreCreate() local
50 if (semaphore == NULL) { in SemaphoreCreate()
56 (void)memset_s(semaphore, sizeof(Semaphore), 0, sizeof(Semaphore)); in SemaphoreCreate()
57 semaphore->fd = efd; in SemaphoreCreate()
58 semaphore->mutex = mutex; in SemaphoreCreate()
60 return semaphore; in SemaphoreCreate()
/ohos5.0/drivers/hdf_core/adapter/khdf/linux/osal/src/
H A Dosal_sem.c30 struct semaphore *sem_tmp = NULL; in OsalSemInit()
37 sem_tmp = (struct semaphore *)OsalMemCalloc(sizeof(*sem_tmp)); in OsalSemInit()
60 ret = down_interruptible((struct semaphore *)sem->realSemaphore); in OsalSemWait()
63 ret = down_timeout((struct semaphore *)sem->realSemaphore, msecs_to_jiffies(millisec)); in OsalSemWait()
85 up((struct semaphore *)sem->realSemaphore); in OsalSemPost()
/ohos5.0/foundation/communication/bluetooth_service/services/bluetooth/stack/src/btm/
H A Dbtm_thread.c85 Semaphore *semaphore; member
101 if (context->semaphore != NULL) { in RunAllTaskInQueueTask()
102 SemaphorePost(context->semaphore); in RunAllTaskInQueueTask()
110 .semaphore = NULL, in RunAllTaskInQueue()
116 context.semaphore = SemaphoreCreate(0); in RunAllTaskInQueue()
118 SemaphoreWait(context.semaphore); in RunAllTaskInQueue()
119 SemaphoreDelete(context.semaphore); in RunAllTaskInQueue()
/ohos5.0/commonlibrary/rust/ylong_runtime/ylong_runtime/src/sync/
H A Dsemaphore_inner.rs38 semaphore: &'a SemaphoreInner, field
221 fn new(semaphore: &'a SemaphoreInner) -> Permit { in new()
223 semaphore, in new()
234 let (semaphore, waker_index, enqueue) = unsafe { in poll()
236 (me.semaphore, &mut me.waker_index, &mut me.enqueue) in poll()
239 semaphore.poll_acquire(cx, waker_index, enqueue) in poll()
247 let _ = self.semaphore.waker_list.remove(self.waker_index.unwrap()); in drop()
H A Dmod.rs22 pub mod semaphore; module
30 pub use semaphore::{AutoRelSemaphore, AutoRelSemaphorePermit, Semaphore, SemaphorePermit};
/ohos5.0/drivers/hdf_core/framework/utils/src/
H A Dosal_msg_queue.c17 OsalSemInit(&queue->semaphore, 0); in OsalMessageQueueInit()
26 OsalSemDestroy(&queue->semaphore); in OsalMessageQueueDestroy()
54 OsalSemPost(&queue->semaphore); in HdfMessageQueueEnqueue()
75 OsalSemWait(&queue->semaphore, OSAL_WAIT_FOREVER); in HdfMessageQueueNext()
/ohos5.0/foundation/ai/ai_engine/test/common/
H A DBUILD.gn34 "//foundation/ai/ai_engine/services/common/platform/semaphore:semaphore",
44 "semaphore/semaphore_test.cpp",
/ohos5.0/foundation/ai/ai_engine/services/common/
H A DCMakeLists.txt69 platform/semaphore/include/i_semaphore.h
70 platform/semaphore/include/simple_event_notifier.h
71 platform/semaphore/include/simple_event_notifier.inl
72 platform/semaphore/source/semaphore.cpp
/ohos5.0/drivers/hdf_core/adapter/khdf/linux/platform/mipi_dsi/
H A Dmipi_tx_dev.c59 struct semaphore sem;
206 static int32_t SemaInit(struct semaphore *sem, uint16_t val) in SemaInit()
216 static void SemaDestroy(struct semaphore *sem) in SemaDestroy()
222 static int32_t SemaDownInterruptable(struct semaphore *sem) in SemaDownInterruptable()
227 static void SemaUp(struct semaphore *sem) in SemaUp()
277 static struct semaphore *GetSemaFromFilep(struct file *filep) in GetSemaFromFilep()
499 struct semaphore *sem = NULL; in MipiDsiDevIoctl()
/ohos5.0/foundation/ai/ai_engine/services/common/platform/semaphore/
H A DBUILD.gn13 source_set("semaphore") {
14 sources = [ "source/semaphore.cpp" ]
/ohos5.0/foundation/ai/ai_engine/services/server/
H A DBUILD.gn38 "//foundation/ai/ai_engine/services/common/platform/semaphore:semaphore",
/ohos5.0/foundation/graphic/graphic_2d/rosen/test/2d_graphics/unittest/skia_adapter/
H A Dskia_surface_test.cpp130 VkSemaphore semaphore; variable
131 surface->Wait(5, semaphore); // 5: time
136 surface->Wait(1000, semaphore);
/ohos5.0/foundation/graphic/graphic_2d/rosen/modules/2d_graphics/src/drawing/draw/
H A Dsurface.cpp157 void Surface::Wait(int32_t time, const VkSemaphore& semaphore) in Wait() argument
165 impl_->Wait(time, semaphore); in Wait()
/ohos5.0/drivers/hdf_core/framework/utils/include/
H A Dosal_msg_queue.h23 struct OsalSem semaphore; member

123