Skip to content

Latest commit

 

History

History
30 lines (20 loc) · 547 Bytes

File metadata and controls

30 lines (20 loc) · 547 Bytes

mutex.js

A Mutex locking system non-blocking for Javascript

Usage

Download the library and include it in your html.

<script src="js/mutex.js"></script>

Then you just need to create an instance of the class and use it this way.

<script>

	var mutex = new Mutex();

	mutex.lock(function(){
		/* The code to process goes here */
		console.log('Processing the code');

		/* When the processing is finished */
		mutex.unlock();
	});

</script>