#1 2014-09-28 19:04:56

cheemeng
Member
From: Malaysia
Registered: 2011-08-09
Posts: 61

Does TMemoryMapText.AddInMemoryLine need Locking?

Hi Arnaud,

I do not see any locking in the procedure, so I'm wondering if it is as thread-safe as its disk-based counterpart, TSynLog.LogInternal?

Thanks!

Offline

#2 2014-09-28 19:07:20

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,612
Website

Re: Does TMemoryMapText.AddInMemoryLine need Locking?

AFAIR this method is not thread safe: it is to be used from a single thread, e.g. from the UI thread of the LogView tool.

Offline

#3 2014-09-29 07:35:20

cheemeng
Member
From: Malaysia
Registered: 2011-08-09
Posts: 61

Re: Does TMemoryMapText.AddInMemoryLine need Locking?

OK, I'll remember to lock it if I need to use it from multiple threads. Thanks Arnaud!

Offline

Board footer

Powered by FluxBB