Project JEDI - Issue Tracker
Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0003645 [JEDI VCL] 00 JVCL Components minor always 2006-04-18 16:54 2006-04-19 05:35
Reporter Arioch View Status public  
Assigned To obones
Priority normal Resolution fixed  
Status resolved   Product Version 3.10
Summary 0003645: TJvThread.Execute - may lead to inconsistent state
Description Assume that TJvThread.Exclusive is set to TRUE.


----- quote from TJvThread.Execute ----
  if Assigned(FOnExecute) then
  begin
    Inc(FThreadCount);
---------------------------------------

What if some Exception would be thrown hereafter ?
There are 3 lines that potentially can cause it.

1: BaseThread := TJvBaseThread.Create(Self, FOnExecute, P);
2: FThreads.Add(BaseThread);
3: DoCreate;

Then thread is not created/started but FThreadCount is not reverted (decremented).
So, any later call to .Execute would just quit because of
----------
  if Exclusive and OneThreadIsRunning then
    Exit;
----------

There is no single thread running, but .OneThreadIsRunning claims it is!
Additional Information
Tags No tags attached.
Attached Files

- Relationships

-  Notes
(0009136)
Arioch (developer)
2006-04-18 17:43

To add: OneThreadIsRunning is bad name, it confuses do we mean 'AtLeastOne' or 'ExactlyOne'
It is better to be renamed to SomeThreadIsRunning

What is the sense there to have an extra FThreadCount when we already do have FThread.Count.
Speed can't be the reason, since we heavily use, for example, FThread[i] even for .Exclusive jvthreads.
(0009142)
obones (administrator)
2006-04-19 05:35

This has now been changed in SVN

- Issue History
Date Modified Username Field Change
2006-04-18 16:54 Arioch New Issue
2006-04-18 17:43 Arioch Note Added: 0009136
2006-04-19 05:35 obones Status new => resolved
2006-04-19 05:35 obones Resolution open => fixed
2006-04-19 05:35 obones Assigned To => obones
2006-04-19 05:35 obones Note Added: 0009142


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker