audreyt / node-webworker-threads

Lightweight Web Worker API implementation with native threads
https://npmjs.org/package/webworker-threads
Other
2.3k stars 149 forks source link

Eliminate unneeded Locker code #141

Closed davisjam closed 7 years ago

davisjam commented 7 years ago

Problem: We were running the same code in both branches of an ifdef. Solution: Eliminate the ifdef.

Problem: We were instantiating a Locker as the only operation in a scope. Since Locker uses the RAII pattern, this was essentially a potentially-expensive no-op. Solution: Don't do that.

This PR resolves #140