[Ginp-developers] Bug in thred logic
Brought to you by:
burchbri,
dougculnane
From: Doug C. <do...@cu...> - 2005-03-25 12:57:38
|
Dear Justin, There is a bug in the thread logic. I tried to fix this but I have no experience with synchronized threads. I would fix this by removing the synchronized bit out of the application, which you may not approve of. Therefore please have a look at the code because it does not work on tomcat. I have to click links several times to get a response. I think that my encoding problem is related to this, but I can not know for sure until this is fixed. From Configuration I have removed this redundant code which I do not think is relevant but I thought I would mention it just in case: private boolean makeThumbsFlag=true; /** * Synchronized to make thread safe * @return whether to launch a make thumbs thread. */ public synchronized boolean makeThumbs() { if (makeThumbsFlag==true) { makeThumbsFlag=false; return true; } return false; } /** * Call when the make thumbs thread has finished */ public void doneMakingThumbs() { makeThumbsFlag=true; } If you do not have time for this then let me know and I will reprogram the synchronized bit out and make a series of images for the different Thumbnail errors. ThumbnailBeingMadePleaseWaitAndRefresh.jpg OriginalFileNotFound.jpg CanNotWriteToDirectory.jpg ... This may not be very elegant but it will be safer. All the best, Happy Easter, Doug |