Can somebody explain how I can implement semaphore in Objective-C?
I did a lot of google searching on the topic, but I haven’t found anything understandable.
Can somebody explain how I can implement semaphore in Objective-C? I did a lot
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
C apis can be found in
sys/semaphore.h. use these in your objc wrapper/implementation.this basic example is the first result when ‘sem_trywait example’ is googled. it shows you how you can use these apis.
then a minimal interface would take this form:
but it’s likely that you will also want the object to abstract the init and destruct routines from the client.