File tree Expand file tree Collapse file tree 1 file changed +16
-14
lines changed
net.lecousin.core/src/main/java/net/lecousin/framework/io/buffering Expand file tree Collapse file tree 1 file changed +16
-14
lines changed Original file line number Diff line number Diff line change @@ -117,23 +117,25 @@ protected void loadBuffer(int index) {
117117 operation (loading ).listenInline (new Runnable () {
118118 @ Override
119119 public void run () {
120+ SynchronizationPoint <NoException > sp ;
120121 synchronized (buffer ) {
121- if (buffer .loading == null ) return ;
122- if (!loading .isSuccessful ()) {
123- if (loading .isCancelled ()) buffer .loading .cancel (loading .getCancelEvent ());
124- else {
125- buffer .error = loading .getError ();
126- buffer .loading .unblock ();
127- }
128- buffer .buffer = null ;
129- return ;
122+ sp = buffer .loading ;
123+ if (sp == null ) return ;
124+ }
125+ if (!loading .isSuccessful ()) {
126+ if (loading .isCancelled ()) sp .cancel (loading .getCancelEvent ());
127+ else {
128+ buffer .error = loading .getError ();
129+ sp .unblock ();
130130 }
131- buffer .len = loading .getResult ().intValue ();
132- if (buffer .len < 0 ) buffer .len = 0 ;
133- buffer .lastRead = System .currentTimeMillis ();
134- manager .newBuffer (buffer );
135- buffer .loading .unblock ();
131+ buffer .buffer = null ;
132+ return ;
136133 }
134+ buffer .len = loading .getResult ().intValue ();
135+ if (buffer .len < 0 ) buffer .len = 0 ;
136+ buffer .lastRead = System .currentTimeMillis ();
137+ manager .newBuffer (buffer );
138+ sp .unblock ();
137139 }
138140 });
139141 }
You can’t perform that action at this time.
0 commit comments