Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

Thread safe lock

$
0
0

I use Task.Run to start a background thread for receiving network datas.
The user press the button on the UI, the UI thread will be send network data with the TcpClient which create on the background thread.
There is two thread need to use the TcpClient object, so for thread safe, I need a lock to protect it.

I am the new to Xamarin.Forms, so I don't know how write the lock statements.
Is there any samples for me ?


Viewing all articles
Browse latest Browse all 77050

Trending Articles