cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
UNIX/Linux Programming
semaphores
semaphores
Jun 11, 2021 at 7:37am UTC
onetwo123
(74)
What do these lines of code mean (each separately). It is said that here we set the semaphore to -1 (occupy it) before the critical part, but what happens on each line.
1
2
3
4
sb[0].sem_num = 0; sb[0].sem_flg = SEM_UNDO; sb[0].sem_op = -1; semop(semid,sb,1);
Last edited on
Jun 11, 2021 at 7:37am UTC
Jun 11, 2021 at 11:06am UTC
coder777
(8442)
Take a look at this:
https://www.tutorialspoint.com/unix_system_calls/semop.htm
That should answer your question.
Topic archived. No new replies allowed.