01 August 2021, 22:00 | #21 |
Registered User
Join Date: Jan 2019
Location: Germany
Posts: 3,215
|
Looks bad. First of all, the signal is triggered once, but if multiple messages are in the port, you will deadlock on a signal that was already cleared. Second, you do not check which signal was received. Third, you miss a check for NULL because you collected a signal from a different port. The 0xf800... something is because you are not running MuForce (do that!) and you try to evaluate a message through a NULL pointer, and thus instead evaluate the interrupt vector base with offset 0. Thus: [code] signals = Wait(...); if (signal & (1UL
|
01 August 2021, 22:01 | #22 |
Registered User
Join Date: Jan 2019
Location: Germany
Posts: 3,215
|
Looks bad. First of all, the signal is triggered once, but if multiple messages are in the port, you will deadlock on a signal that was already cleared. Second, you do not check which signal was received. Third, you miss a check for NULL because you collected a signal from a different port. The 0xf800... something is because you are not running MuForce (do that!) and you try to evaluate a message through a NULL pointer, and thus instead evaluate the interrupt vector base with offset 0.
Code:
signals = Wait(...); if (signal & (1UL << windowsignal)) { while(msg = GT_GetIMsg(...)) { ... handle messsage ... GT_ReplyIMsg(msg); } } else if (signal & (othersignalmask)) { ... } |
02 August 2021, 04:28 | #23 |
Registered User
Join Date: Apr 2009
Location: N/A
Posts: 962
|
Thank you for the sample code. This helped me a lot. I have re-organized my code to follow the same structure. The code is more readable like this and while going through the changes I also spotted an issue with how I was managing the second signal mask.
Will read about MuForce. |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
intuition questions | meynaf | Coders. System | 11 | 09 December 2020 11:27 |
Help needed for an Intuition event loop | thyslo | Coders. System | 8 | 29 October 2018 19:08 |
C Intuition Help | plasmab | Coders. General | 7 | 15 October 2018 09:05 |
ClassicWB MultiBoot Menu (right click/left click on boot) not working | DuaneL | project.ClassicWB | 9 | 13 September 2016 16:32 |
click click bloody click | Dave_wb | support.Hardware | 14 | 12 April 2005 09:31 |
|
|