Removed the old Perl Supports.
This commit is contained in:
parent
25dfe7278c
commit
121b3c31d2
2 changed files with 3 additions and 1107 deletions
|
@ -81,7 +81,6 @@ use Slic3r::Print;
|
|||
use Slic3r::Print::GCode;
|
||||
use Slic3r::Print::Object;
|
||||
use Slic3r::Print::Simple;
|
||||
use Slic3r::Print::SupportMaterial;
|
||||
use Slic3r::Surface;
|
||||
our $build = eval "use Slic3r::Build; 1";
|
||||
use Thread::Semaphore;
|
||||
|
@ -140,57 +139,6 @@ sub spawn_thread {
|
|||
return $thread;
|
||||
}
|
||||
|
||||
# If the threading is enabled, spawn a set of threads.
|
||||
# Otherwise run the task on the current thread.
|
||||
# Used for
|
||||
# Slic3r::Print::Object->layers->make_perimeters : This is a pure C++ function.
|
||||
# Slic3r::Print::Object->layers->make_fill : This is a pure C++ function.
|
||||
# Slic3r::Print::SupportMaterial::generate_toolpaths
|
||||
sub parallelize {
|
||||
my %params = @_;
|
||||
|
||||
lock @threads;
|
||||
if (!$params{disable} && $Slic3r::have_threads && $params{threads} > 1) {
|
||||
my @items = (ref $params{items} eq 'CODE') ? $params{items}->() : @{$params{items}};
|
||||
my $q = Thread::Queue->new;
|
||||
$q->enqueue(@items, (map undef, 1..$params{threads}));
|
||||
|
||||
$parallel_sema = Thread::Semaphore->new(-$params{threads});
|
||||
$parallel_sema->up;
|
||||
my $thread_cb = sub {
|
||||
# execute thread callback
|
||||
$params{thread_cb}->($q);
|
||||
|
||||
# signal the parent thread that we're done
|
||||
$parallel_sema->up;
|
||||
|
||||
# cleanup before terminating thread
|
||||
Slic3r::thread_cleanup();
|
||||
|
||||
# This explicit exit avoids an untrappable
|
||||
# "Attempt to free unreferenced scalar" error
|
||||
# triggered on Ubuntu 12.04 32-bit when we're running
|
||||
# from the Wx plater and
|
||||
# we're reusing the same plater object more than once.
|
||||
# The downside to using this exit is that we can't return
|
||||
# any value to the main thread but we're not doing that
|
||||
# anymore anyway.
|
||||
threads->exit;
|
||||
};
|
||||
|
||||
@_ = ();
|
||||
my @my_threads = map spawn_thread($thread_cb), 1..$params{threads};
|
||||
|
||||
# We use a semaphore instead of $th->join because joined threads are
|
||||
# not listed by threads->list or threads->object anymore, thus can't
|
||||
# be signalled.
|
||||
$parallel_sema->down;
|
||||
$_->detach for @my_threads;
|
||||
} else {
|
||||
$params{no_threads_cb}->();
|
||||
}
|
||||
}
|
||||
|
||||
# call this at the very end of each thread (except the main one)
|
||||
# so that it does not try to free existing objects.
|
||||
# at that stage, existing objects are only those that we
|
||||
|
@ -313,7 +261,9 @@ sub resume_all_threads {
|
|||
# So this conversion seems to make the most sense on Windows.
|
||||
sub encode_path {
|
||||
my ($path) = @_;
|
||||
|
||||
|
||||
# UTF8 encoding is not unique. Normalize the UTF8 string to make the file names unique.
|
||||
# Unicode::Normalize::NFC() returns the Normalization Form C (formed by canonical decomposition followed by canonical composition).
|
||||
$path = Unicode::Normalize::NFC($path);
|
||||
$path = Encode::encode(locale_fs => $path);
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue