From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Thu, 16 Nov 1995 15:27:11 -0500 From: forsyth@plan9.cs.york.ac.uk forsyth@plan9.cs.york.ac.uk Subject: alef bug Topicbox-Message-UUID: 34e4d54a-eac8-11e9-9e20-41e7f4b1d025 Message-ID: <19951116202711.BjtbwWObIEIJNMNwmkvMg0b-WKi860Hz8MnTGND3Pw8@z> a student found an unpleasant feature of !{} which turns out to be a bug on closer examination. for example: #include void crit2 (void) !{ print ("world\n"); } void crit1 (void) !{ print ("hello\n"); crit2 (); } void main (void) { crit1 (); } this locks up because internnode uses sprint(buf, ".i%d", stmp++); but stmp is reset by fundecl (possibly right for some calls of internnode, but not in this case). the result is that several !{} in different functions end up using the same synchronisation variable (but not if they appear in the same function, or different source files).