English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. C/C++

 
 
Thread Tools
Old 27 October 2022, 22:25   #1
Sim085
Registered User
 
Join Date: Apr 2009
Location: N/A
Posts: 962
How can I implement locks?

Hello, from what I can see pthreads are not available in amiga/vbcc? (not sure if in AmigaOS in general or just vbcc implementation). When I try to use #include <pthread.h> I get pthread.h not found.


Given this, is there any other way how I can implement a lock/release mechanism in C on Amiga OS?
Sim085 is offline  
Old 28 October 2022, 00:06   #2
robinsonb5
Registered User
 
Join Date: Mar 2012
Location: Norfolk, UK
Posts: 1,157
What you're looking for is semaphores, as provided by exec.library.

Check out struct SignalSemaphore, ObtainSemaphore(), ObtainSemaphoreShared(), AttemptSemaphore(), AttemptSemaphoreShared() and ReleaseSemaphore().

(I wrote some threading code many years ago - I just remembered it's still online! Maybe it'll be helpful: http://blackfiveservices.co.uk/amiga...hreads_amr.lha )
robinsonb5 is offline  
Old 28 October 2022, 00:07   #3
Sim085
Registered User
 
Join Date: Apr 2009
Location: N/A
Posts: 962
Thank you
Sim085 is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
AGA Palette... how to implement Steve Coders. Asm / Hardware 23 25 November 2018 22:26
Trying to implement joystick code in my stuff Amiga1992 Coders. General 26 03 June 2018 23:03
implement others 68000 machines ? turrican3 support.WinUAE 28 23 November 2017 00:54
Implement More Option For DirectDraw Mode. Zilog request.UAE Wishlist 4 01 August 2014 09:18
Should I implement PM download now ? RCK project.EAB 12 08 January 2002 01:21

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 15:48.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.13155 seconds with 13 queries