Safely writing to the same file in parallel foreach loop

Vijay Nayar madric at gmail.com
Wed Nov 14 09:49:03 PST 2012


On Wednesday, 14 November 2012 at 16:43:37 UTC, Joseph Rushton 
Wakeling wrote:
> On 11/14/2012 05:16 PM, H. S. Teoh wrote:
> I take it there's no more "native-to-D" way of implementing a 
> file lock? :-(

Could you put the file access in a synchronized block?

http://dlang.org/statement.html#SynchronizedStatement

  - Vijay






More information about the Digitalmars-d-learn mailing list