os_cp:shmem_semaphores
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| os_cp:shmem_semaphores [2025/06/04 17:47] – jkonczak | os_cp:shmem_semaphores [2026/06/11 09:02] (current) – [POSIX semaphore API] jkonczak | ||
|---|---|---|---|
| Line 300: | Line 300: | ||
| #include < | #include < | ||
| #include < | #include < | ||
| + | #include < | ||
| #define MAX_ELEMENTS_PLUS_ONE 4 | #define MAX_ELEMENTS_PLUS_ONE 4 | ||
| Line 331: | Line 332: | ||
| int main() { | int main() { | ||
| - | struct ring_buffer buffer; | + | struct ring_buffer |
| - | initBuffer(&buffer); | + | initBuffer(buffer); |
| printf(" | printf(" | ||
| " | " | ||
| Line 348: | Line 349: | ||
| switch (cmd[0]) { | switch (cmd[0]) { | ||
| case ' | case ' | ||
| - | put(&buffer, &item); | + | put(buffer, &item); |
| break; | break; | ||
| case ' | case ' | ||
| - | get(&buffer, &item); | + | get(buffer, &item); |
| printf(" | printf(" | ||
| break; | break; | ||
os_cp/shmem_semaphores.1749059242.txt.gz · Last modified: (external edit)