$.Mutex = (function() {
function Mutex() {
this.def = $.Deferred().resolve();
}
Mutex.prototype.exec = function(action) {
var current = this.def;
var next = this.def = $.Deferred();
return current.then(function() {
return $.when(action()).always(function() {
next.resolve();
});
});
};
return Mutex;
})();
潇潇雨雨
摇曳的蔷薇
相关分类