scratchfoundation / scratch-link

Device interoperability layer for Windows and MacOS
BSD 3-Clause "New" or "Revised" License
102 stars 83 forks source link

Windows: since Fleck is thread-safe, we may not need _socketLock #152

Closed cwillisf closed 4 years ago

cwillisf commented 4 years ago

Expected Behavior

We should only use thread synchronization when necessary.

Actual Behavior

In Session.cs, interaction with _webSocket is protected by locking a semaphore called _socketLock. Fleck, the WebSocket library we use, claims to be thread-safe so we may not need this semaphore. Removing it may improve performance slightly. See also statianzo/Fleck#191.

Thanks to @terado0618 for bringing this up!