Re: [Lazarus] Enqueuing a callback from a thread via other class - or am I overcomplicating this ?

2017-06-20 Thread Lukasz Sokol via Lazarus
On 19/06/17 10:05, Lukasz Sokol via Lazarus wrote: > On 19/06/17 00:30, José Mejuto via Lazarus wrote: >> El 18/06/2017 a las 22:44, el es via Lazarus escribió: >> >>> Hence the object, would have to have ITS callback routine be something like >>> a TNotifyEvent ( procedure(AObject: TSomeObject)

Re: [Lazarus] Enqueuing a callback from a thread via other class - or am I overcomplicating this ?

2017-06-19 Thread Michael Schnell via Lazarus
On 17.06.2017 22:25, el es via Lazarus wrote: Where does the call queued from a thread, return to ? From the POV of the application programmer: "nowhere". it's just another (main-Thread-) "Event" that (like "OnClick") gets "fired" by the Lazarus/fpc infrastructure and is done. The object's

Re: [Lazarus] Enqueuing a callback from a thread via other class - or am I overcomplicating this ?

2017-06-19 Thread Lukasz Sokol via Lazarus
On 19/06/17 00:30, José Mejuto via Lazarus wrote: > El 18/06/2017 a las 22:44, el es via Lazarus escribió: > >> Hence the object, would have to have ITS callback routine be something like >> a TNotifyEvent ( procedure(AObject: TSomeObject) of object, or something), >> and the flag set is set

Re: [Lazarus] Enqueuing a callback from a thread via other class - or am I overcomplicating this ?

2017-06-18 Thread el es via Lazarus
On 18-Jun-17 11:20, Juha Manninen via Lazarus wrote: On Sat, Jun 17, 2017 at 11:25 PM, el es via Lazarus wrote: But when, during the course of Queue()d callback, I FreeAndNil() the object that had the pointer to the callback procedure, I get SIGSEGV pointing at

Re: [Lazarus] Enqueuing a callback from a thread via other class - or am I overcomplicating this ?

2017-06-18 Thread Juha Manninen via Lazarus
On Sat, Jun 17, 2017 at 11:25 PM, el es via Lazarus wrote: > But when, during the course of Queue()d callback, > I FreeAndNil() the object that had the pointer to the callback procedure, I > get SIGSEGV pointing at CheckSynchronize in Application. (address

Re: [Lazarus] Enqueuing a callback from a thread via other class - or am I overcomplicating this ?

2017-06-17 Thread el es via Lazarus
Hindsight, schmindsight, but here is another question: Where does the call queued from a thread, return to ? As in, the thread calls Queue() on a method of the object we're interested in; and that in turn calls a method / procedure more like / from the 'main form' unit. The object's lifetime

Re: [Lazarus] Enqueuing a callback from a thread via other class - or am I overcomplicating this ?

2017-06-14 Thread Lukasz Sokol via Lazarus
On 14/06/17 11:33, Mattias Gaertner via Lazarus wrote: > On Wed, 14 Jun 2017 11:12:11 +0100 > Lukasz Sokol via Lazarus wrote: > >> [...] >> SomeClassLockedList := SomeClassList.LockedList; // there are >> try/excepts around all here, but did not want to

Re: [Lazarus] Enqueuing a callback from a thread via other class - or am I overcomplicating this ?

2017-06-14 Thread Mattias Gaertner via Lazarus
On Wed, 14 Jun 2017 11:12:11 +0100 Lukasz Sokol via Lazarus wrote: >[...] > SomeClassLockedList := SomeClassList.LockedList; // there are > try/excepts around all here, but did not want to muddle the picture >

[Lazarus] Enqueuing a callback from a thread via other class - or am I overcomplicating this ?

2017-06-14 Thread Lukasz Sokol via Lazarus
Hi, I have a TThread, that processes a T(Thread)List of TSomeClass objects continuously. I want to have a callback in the TSomeClass, to which another class can put their procedure to call into, but the callback needs to be 'thread safe' (because it can be accessed (read) by GUI related