On Thu, 31 Jul 2008 11:02:28 +0200 Florian Klaempfl <[EMAIL PROTECTED]> wrote:
> Before we discuss endless about useless stuff, I'll make a proposal > for a first addition: support of the synchronized keyword. It does no > more than protecting a procedure automatically by a critical section > so only one thread can enter it. But I want to extend it. First, it > can be applied also to classes and object: > > tmyclass = class(...) synchronized > > This means that all classes synchronize against one critical section. Do you mean one global crit sect per class (and descendants) or one global crit sect for all classes? > Further, it allows an additional symbol to be given > > procedure p;synchronized mycriticialsection; > > it must be of the type System.TRTLCriticalSection and the procedure > will be synchronized against this critical section. Will this also allowed for methods? > Besides saving the typing of endless try ... finally statements and > the initialiation of the unnamed critical sections, it creates also > slightly better code because the LeaveCriticalSection call can be > inside the implicit exception frame which is created anyways. > > Any suggestions about doing it better? > > BTW: I'll ignore comments like "nobody needs this", I need it :) I like it. Mattias _______________________________________________ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel