ChunkWriter sync trying to improve chunk join speed 2
This commit is contained in:
tonikelope 2021-01-13 13:14:20 +01:00
parent 1b8467c7a6
commit e503ee5b74
4 changed files with 17 additions and 2 deletions

View File

@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.tonikelope</groupId>
<artifactId>MegaBasterd</artifactId>
<version>7.39</version>
<version>7.40</version>
<packaging>jar</packaging>
<dependencies>
<dependency>

View File

@ -159,6 +159,21 @@ public class ChunkWriterManager implements Runnable, SecureSingleThreadNotifiabl
if (_file_size > 0) {
while (!_exit && (!_download.isStopped() || !_download.getChunkworkers().isEmpty()) && _bytes_written < _file_size) {
if (!download_finished && _download.getProgress() == _file_size) {
_download.getMain_panel().getDownload_manager().getTransference_running_list().remove(_download);
_download.getMain_panel().getDownload_manager().secureNotify();
_download.getView().printStatusNormal("Download finished. Joining file chunks, please wait...");
_download.getView().getPause_button().setVisible(false);
_download.getMain_panel().getGlobal_dl_speed().detachTransference(_download);
_download.getView().getSpeed_label().setVisible(false);
_download.getView().getSlots_label().setVisible(false);
_download.getView().getSlot_status_label().setVisible(false);
_download.getView().getSlots_spinner().setVisible(false);
download_finished = true;
}
synchronized (ChunkWriterManager.class) {
boolean chunk_io_error;

View File

@ -60,7 +60,7 @@ import javax.swing.UIManager;
*/
public final class MainPanel {
public static final String VERSION = "7.39";
public static final String VERSION = "7.40";
public static final boolean FORCE_SMART_PROXY = false; //TRUE FOR DEBUGING SMART PROXY
public static final int THROTTLE_SLICE_SIZE = 16 * 1024;
public static final int DEFAULT_BYTE_BUFFER_SIZE = 16 * 1024;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 184 KiB

After

Width:  |  Height:  |  Size: 178 KiB