Problem with Socket under Linux...

Göran Hultgren goran.hultgren at bluefish.se
Sun Apr 28 21:27:58 UTC 2002


Hi all!

Quoting John M McIntosh <johnmci at smalltalkconsulting.com>:
[SNIP] 
> But I\'ll note Ian changed the code a few days ago to
> 
>   void notify(privateSocketStruct *pss, int eventMask)
>   {
>     int mask= pss->pendingEvents & eventMask;
>     if (mask & CONN_NOTIFY) 
> interpreterProxy->signalSemaphoreWithIndex((pss)->connSema);
>     if (mask & READ_NOTIFY) 
> interpreterProxy->signalSemaphoreWithIndex((pss)->readSema);
>     if (mask & WRITE_NOTIFY) 
> interpreterProxy->signalSemaphoreWithIndex((pss)->writeSema);
>     pss->pendingEvents&= ~mask;
>   }
> 
> I\'d bet turning off all the bits via pss->pendingEvents= 0; is wrong, 
> since my description states \"and the trigger is true, the trigger is 
> reset.\" done by  pss->pendingEvents&= ~mask; (no?) versus resetting 
> all the triggers (=0).

And DO note that now it also says:
     int mask= pss->pendingEvents & eventMask;

...and not \"|\"! Quite an important change if you ask me... And if you don\'t
agree then I don\'t understand squat of this. :-) (That darn \"|\" really gave me a
hard time understanding the \"logic\" here, but now when it\'s a \"&\" things are
looking much more understandable)

regards, Göran

Göran Hultgren, goran.hultgren at bluefish.se
GSM: +46 70 3933950, http://www.bluefish.se
\"Department of Redundancy department.\" -- ThinkGeek



More information about the Squeak-dev mailing list