Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 02 Oct 2000 00:17:11 +0200 (IST)
From:      Roman Shterenzon <roman@harmonic.co.il>
To:        freebsd-stable@freebsd.org
Subject:   Pthreads saga continues..
Message-ID:  <970438631.39d7b7e76d963@webmail.harmonic.co.il>

next in thread | raw e-mail | index | archive | help
This message is in MIME format.

---MOQ9704386317946fe126fe4be24aaf7570972c0367b
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit

Good day,
Isn't the main thread should break out of accept when it receives signal from
the other thread?
Am I missing something?

--Roman Shterenzon, UNIX System Administrator and Consultant
[ Xpert UNIX Systems Ltd., Herzlia, Israel. Tel: +972-9-9522361 ]

---MOQ9704386317946fe126fe4be24aaf7570972c0367b
Content-Type: application/octet-stream; name="pthreadtest2.c"; name="pthreadtest2.c"
Content-Transfer-Encoding: base64
Content-Disposition: inline; filename="pthreadtest2.c"


I2luY2x1ZGUgPHB0aHJlYWQuaD4KI2luY2x1ZGUgPHN5cy90eXBlcy5oPgojaW5jbHVkZSA8c3lz
L3NvY2tldC5oPgojaW5jbHVkZSA8bmV0aW5ldC9pbi5oPgojaW5jbHVkZSA8c2lnbmFsLmg+CiNp
bmNsdWRlIDxlcnJuby5oPgoKaW50IHNvY2s7CmludCBjbWQ9MDsKcHRocmVhZF90IG1haW5fdGlk
OwoKdm9pZCogcm91dGluZSh2b2lkICphcmcpCnsKICBwdGhyZWFkX3QgbXlfdGlkOwogLyogd2hp
bGUoMSk7ICovCiAgc2xlZXAoNSk7CiAgbXlfdGlkPXB0aHJlYWRfc2VsZigpOyAKICBwcmludGYo
IiVsZDogU2VuZGluZyAlbGQgc2lnbmFsXG4iLCBteV90aWQsIG1haW5fdGlkKTsKICBwdGhyZWFk
X2tpbGwobWFpbl90aWQsIFNJR1VTUjEpOwogIHByaW50ZigiJWxkOiBTZW50ICVsZCBzaWduYWxc
biIsIG15X3RpZCwgbWFpbl90aWQpOwp9Cgp2b2lkIHVzcjFoYW5kbG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Gxpc3Rl
bihzb2NrLCAyKSA9PSAtMSApIHsKICAgIHBlcnJvcigibGlzdGVuIik7CiAgICBwdGhyZWFkX2tp
bGwodGlkLCBTSUdURVJNKTsKICAgIGV4aXQoLTEpOwogIH0KICB3aGlsZSgxKSB7CiAgICBpZiAo
KCBuZXdmZD1hY2NlcHQoc29jaywgKHN0cnVjdCBzb2NrYWRkciAqKSZoaXNhZGRyLCAmc2luX3Np
emUpKT09LTEpewogICAgICBpZiAoIGVycm5vPT1FSU5UUiApIHsKICAgICAgICBwcmludGYoIkdv
dCBhIHNpZ25hbFxuIik7CiAgICAgICAgaWYgKCBjbWQgKSB7CiAgICAgICAgICBwcmludGYoIkl0
IHdhcyBhIHNpZ24hXG4iKTsKICAgICAgICAgIGJyZWFrOwogICAgICAgIH0KICAgICAgfQogICAg
ICBwZXJyb3IoImFjY2VwdCIpOwogICAgICBleGl0KC0xKTsKICAgIH0KICAgIHByaW50ZigiY29u
bmVjdGlvbiBhY2NlcHRlZFxuIik7CiAgICBjbG9zZShuZXdmZCk7CiAgfQogIHB0aHJlYWRfa2ls
bCh0aWQsIFNJR1RFUk0pOwogIHJldHVybiAwOwp9Cg==


---MOQ9704386317946fe126fe4be24aaf7570972c0367b--


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?970438631.39d7b7e76d963>