Merge pull request #256 from mikeprimm/master
More 1.7 stuff: add sticky piston to colorschemes, fix spurrious read lock timeouts on web
This commit is contained in:
commit
163a37fcb1
5 changed files with 19 additions and 8 deletions
|
|
@ -54,6 +54,8 @@ Powered Rail
|
||||||
27 150 134 102 180 120 107 81 180 75 67 51 180 60 53 40 180
|
27 150 134 102 180 120 107 81 180 75 67 51 180 60 53 40 180
|
||||||
Detector Rail
|
Detector Rail
|
||||||
28 150 134 102 180 120 107 81 180 75 67 51 180 60 53 40 180
|
28 150 134 102 180 120 107 81 180 75 67 51 180 60 53 40 180
|
||||||
|
Sticky Piston
|
||||||
|
29 157 128 79 255 96 96 96 255 78 64 39 255 48 48 48 255
|
||||||
Cobweb
|
Cobweb
|
||||||
30 138 145 145 255 110 115 115 255 69 72 72 255 55 57 57 255
|
30 138 145 145 255 110 115 115 255 69 72 72 255 55 57 57 255
|
||||||
Tall Grass
|
Tall Grass
|
||||||
|
|
|
||||||
|
|
@ -54,6 +54,8 @@ Powered Rail
|
||||||
27 150 134 102 180 120 107 81 180 75 67 51 180 60 53 40 180
|
27 150 134 102 180 120 107 81 180 75 67 51 180 60 53 40 180
|
||||||
Detector Rail
|
Detector Rail
|
||||||
28 150 134 102 180 120 107 81 180 75 67 51 180 60 53 40 180
|
28 150 134 102 180 120 107 81 180 75 67 51 180 60 53 40 180
|
||||||
|
Sticky Piston
|
||||||
|
29 157 128 79 255 96 96 96 255 78 64 39 255 48 48 48 255
|
||||||
Cobweb
|
Cobweb
|
||||||
30 138 145 145 255 110 115 115 255 69 72 72 255 55 57 57 255
|
30 138 145 145 255 110 115 115 255 69 72 72 255 55 57 57 255
|
||||||
Tall Grass
|
Tall Grass
|
||||||
|
|
|
||||||
|
|
@ -54,6 +54,8 @@ Powered Rail
|
||||||
27 150 134 102 180 120 107 81 180 75 67 51 180 60 53 40 180
|
27 150 134 102 180 120 107 81 180 75 67 51 180 60 53 40 180
|
||||||
Detector Rail
|
Detector Rail
|
||||||
28 150 134 102 180 120 107 81 180 75 67 51 180 60 53 40 180
|
28 150 134 102 180 120 107 81 180 75 67 51 180 60 53 40 180
|
||||||
|
Sticky Piston
|
||||||
|
29 157 128 79 255 125 122 116 255 78 64 39 255 88 85 81 255
|
||||||
Cobweb
|
Cobweb
|
||||||
30 138 145 145 255 110 115 115 255 69 72 72 255 55 57 57 255
|
30 138 145 145 255 110 115 115 255 69 72 72 255 55 57 57 255
|
||||||
Tall Grass
|
Tall Grass
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@
|
||||||
26 200 20 20 255 160 16 16 255 100 10 10 255 80 8 8 255
|
26 200 20 20 255 160 16 16 255 100 10 10 255 80 8 8 255
|
||||||
27 150 134 102 180 120 107 81 180 75 67 51 180 60 53 40 180
|
27 150 134 102 180 120 107 81 180 75 67 51 180 60 53 40 180
|
||||||
28 150 134 102 180 120 107 81 180 75 67 51 180 60 53 40 180
|
28 150 134 102 180 120 107 81 180 75 67 51 180 60 53 40 180
|
||||||
|
29 109 80 60 255 111 108 98 255 76 56 41 255 111 108 98 255
|
||||||
30 138 145 145 255 110 115 115 255 69 72 72 255 55 57 57 255
|
30 138 145 145 255 110 115 115 255 69 72 72 255 55 57 57 255
|
||||||
31 97 156 53 255 73 120 38 255 38 68 16 255 26 50 9 255
|
31 97 156 53 255 73 120 38 255 38 68 16 255 26 50 9 255
|
||||||
32 75 44 24 255 60 35 19 255 37 22 12 255 30 18 10 255
|
32 75 44 24 255 60 35 19 255 37 22 12 255 30 18 10 255
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,9 @@ public class FileLockManager {
|
||||||
String fn = f.getPath();
|
String fn = f.getPath();
|
||||||
synchronized(lock) {
|
synchronized(lock) {
|
||||||
boolean got_lock = false;
|
boolean got_lock = false;
|
||||||
boolean first_wait = true;
|
long starttime = 0;
|
||||||
|
if(timeout > 0)
|
||||||
|
starttime = System.currentTimeMillis();
|
||||||
while(!got_lock) {
|
while(!got_lock) {
|
||||||
Integer lockcnt = filelocks.get(fn); /* Get lock count */
|
Integer lockcnt = filelocks.get(fn); /* Get lock count */
|
||||||
if(lockcnt == null) {
|
if(lockcnt == null) {
|
||||||
|
|
@ -85,14 +87,16 @@ public class FileLockManager {
|
||||||
}
|
}
|
||||||
else { /* Write lock in place */
|
else { /* Write lock in place */
|
||||||
try {
|
try {
|
||||||
if((timeout > 0) && (!first_wait)) { /* We already waited */
|
if(timeout < 0) {
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if(timeout < 0)
|
|
||||||
lock.wait();
|
lock.wait();
|
||||||
else
|
}
|
||||||
lock.wait(timeout);
|
else {
|
||||||
first_wait = false;
|
long now = System.currentTimeMillis();
|
||||||
|
long elapsed = now-starttime;
|
||||||
|
if(elapsed > timeout) /* Give up on timeout */
|
||||||
|
return false;
|
||||||
|
lock.wait(timeout-elapsed);
|
||||||
|
}
|
||||||
} catch (InterruptedException ix) {
|
} catch (InterruptedException ix) {
|
||||||
Log.severe("getReadLock(" + fn + ") interrupted");
|
Log.severe("getReadLock(" + fn + ") interrupted");
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue