[kaffe] MediaTracker
Jukka Santala
jsantala@tml.hut.fi
Tue, 28 May 2002 16:18:12 +0300 (EEST)
This message is in MIME format. The first part should be readable text,
while the remaining parts are likely unreadable without MIME-aware tools.
Send mail to mime@docserver.cac.washington.edu for more info.
---559023410-1254324197-1022591892=:21598
Content-Type: TEXT/PLAIN; charset=US-ASCII
This will probably need some further testing. One class in X-Smiles passes
a fake URL to MediaTracker in hopes that it'll fast-fail and just get
ignored. Though we'll probably change that, in interest of compatibility I
wrote a patch to make this work on Kaffe more or less as it seems on other
JRE's. Problem is, it's not exactly well documented.
It appears that with URL class the error occurs even before MediaTracker
enters its wait() section, and hence it never catches the notify() -
leading to "hangs" of several minutes or worse while Kaffe waits to time
out. In this patch, flags are checked for ImageObserver.ERROR before
entering wait(), and the synchronized section has been extended to
encompass all of that to prevent race-conditions between the check and
wait() on the assumption that with an URL the error could come in with
some latency. For the latter reason, imageUpdate() has also been modified
to fire notify() in this case.
We probably SHOULD also check ABORT in the same manner, but since I
couldn't immediately come up with a test-case to compare this against
other JRE's, I didn't add that in yet.
-Jukka Santala
---559023410-1254324197-1022591892=:21598
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="MediaTrack-1.patch"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.SOL.4.10.10205281618120.21598@morphine.tml.hut.fi>
Content-Description:
Content-Disposition: attachment; filename="MediaTrack-1.patch"
SW5kZXg6IGxpYnJhcmllcy9qYXZhbGliL2phdmEvYXd0L01lZGlhVHJhY2tl
ci5qYXZhDQo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQpSQ1MgZmlsZTogL2N2
cy9rYWZmZS9rYWZmZS9saWJyYXJpZXMvamF2YWxpYi9qYXZhL2F3dC9NZWRp
YVRyYWNrZXIuamF2YSx2DQpyZXRyaWV2aW5nIHJldmlzaW9uIDEuMTENCmRp
ZmYgLXUgLXIxLjExIE1lZGlhVHJhY2tlci5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