summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2e987f9)
raw | patch | inline | side by side (parent: 2e987f9)
author | Jakub Narebski <jnareb@gmail.com> | |
Fri, 27 May 2011 13:49:59 +0000 (15:49 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Fri, 27 May 2011 18:00:35 +0000 (11:00 -0700) |
JavaScript is single-threaded, so there is no need for protection
against re-entrancy via inProgress variable.
In particular calls to setInterval handler are stacked if handler
doesn't finish before new interrupt (before new interval). The same
happens with events - they are (hopefully) stacked if even handler
didn't finish work.
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
against re-entrancy via inProgress variable.
In particular calls to setInterval handler are stacked if handler
doesn't finish before new interrupt (before new interval). The same
happens with events - they are (hopefully) stacked if even handler
didn't finish work.
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
gitweb/static/js/blame_incremental.js | patch | blob | history |
index 676da6b590bb9335d8fe8d65d588fc72289b871c..4841805288962d656e7e8aacef83738bd5c51b9a 100644 (file)
// ----------------------------------------------------------------------
-var inProgress = false; // are we processing response
-
/**#@+
* @constant
*/
*
* @param {XMLHttpRequest} xhr: XMLHttpRequest object
*
- * @globals pollTimer, commits, inProgress
+ * @globals pollTimer, commits
*/
function handleError(xhr) {
errorInfo('Server error: ' +
clearInterval(pollTimer);
commits = {}; // free memory
-
- inProgress = false;
}
/**
*
* @param {XMLHttpRequest} xhr: XMLHttpRequest object (unused)
*
- * @globals pollTimer, commits, inProgress
+ * @globals pollTimer, commits
*/
function responseLoaded(xhr) {
clearInterval(pollTimer);
fixColorsAndGroups();
writeTimeInterval();
commits = {}; // free memory
-
- inProgress = false;
}
/**
* handler for XMLHttpRequest onreadystatechange event
* @see startBlame
*
- * @globals xhr, inProgress
+ * @globals xhr
*/
function handleResponse() {
return;
}
- // in case we were called before finished processing
- if (inProgress) {
- return;
- } else {
- inProgress = true;
- }
-
// extract new whole (complete) lines, and process them
while (xhr.prevDataLength !== xhr.responseText.length) {
if (xhr.readyState === 4 &&
xhr.prevDataLength === xhr.responseText.length) {
responseLoaded(xhr);
}
-
- inProgress = false;
}
// ============================================================