mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-23 13:33:02 +08:00
Remove some main thread assertions that are not helping
This is to make experimenting with concurrent execution easier. No functional change in this commit.
This commit is contained in:
parent
6960a56f29
commit
8bed818039
|
@ -23,7 +23,6 @@
|
||||||
/// The source builtin, sometimes called `.`. Evaluates the contents of a file in the current
|
/// The source builtin, sometimes called `.`. Evaluates the contents of a file in the current
|
||||||
/// context.
|
/// context.
|
||||||
maybe_t<int> builtin_source(parser_t &parser, io_streams_t &streams, const wchar_t **argv) {
|
maybe_t<int> builtin_source(parser_t &parser, io_streams_t &streams, const wchar_t **argv) {
|
||||||
ASSERT_IS_MAIN_THREAD();
|
|
||||||
const wchar_t *cmd = argv[0];
|
const wchar_t *cmd = argv[0];
|
||||||
int argc = builtin_count_args(argv);
|
int argc = builtin_count_args(argv);
|
||||||
help_only_cmd_opts_t opts;
|
help_only_cmd_opts_t opts;
|
||||||
|
|
|
@ -479,7 +479,6 @@ bool completer_t::condition_test(const wcstring &condition) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
ASSERT_IS_MAIN_THREAD();
|
|
||||||
bool test_res;
|
bool test_res;
|
||||||
auto cached_entry = condition_cache.find(condition);
|
auto cached_entry = condition_cache.find(condition);
|
||||||
if (cached_entry == condition_cache.end()) {
|
if (cached_entry == condition_cache.end()) {
|
||||||
|
|
|
@ -181,7 +181,6 @@ bool is_thompson_shell_script(const char *path) {
|
||||||
/// This function is similar to launch_process, except it is not called after a fork (i.e. it only
|
/// This function is similar to launch_process, except it is not called after a fork (i.e. it only
|
||||||
/// calls exec) and therefore it can allocate memory.
|
/// calls exec) and therefore it can allocate memory.
|
||||||
[[noreturn]] static void launch_process_nofork(env_stack_t &vars, process_t *p) {
|
[[noreturn]] static void launch_process_nofork(env_stack_t &vars, process_t *p) {
|
||||||
ASSERT_IS_MAIN_THREAD();
|
|
||||||
ASSERT_IS_NOT_FORKED_CHILD();
|
ASSERT_IS_NOT_FORKED_CHILD();
|
||||||
|
|
||||||
// Construct argv. Ensure the strings stay alive for the duration of this function.
|
// Construct argv. Ensure the strings stay alive for the duration of this function.
|
||||||
|
|
|
@ -857,7 +857,6 @@ static std::vector<terminfo_mapping_t> create_input_terminfo() {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool input_terminfo_get_sequence(const wcstring &name, wcstring *out_seq) {
|
bool input_terminfo_get_sequence(const wcstring &name, wcstring *out_seq) {
|
||||||
ASSERT_IS_MAIN_THREAD();
|
|
||||||
assert(s_input_initialized);
|
assert(s_input_initialized);
|
||||||
for (const terminfo_mapping_t &m : *s_terminfo_mappings) {
|
for (const terminfo_mapping_t &m : *s_terminfo_mappings) {
|
||||||
if (name == m.name) {
|
if (name == m.name) {
|
||||||
|
|
|
@ -76,7 +76,6 @@ ssize_t io_buffer_t::read_once(int fd, acquired_lock<separated_buffer_t> &buffer
|
||||||
}
|
}
|
||||||
|
|
||||||
void io_buffer_t::begin_filling(autoclose_fd_t fd) {
|
void io_buffer_t::begin_filling(autoclose_fd_t fd) {
|
||||||
ASSERT_IS_MAIN_THREAD();
|
|
||||||
assert(!fillthread_running() && "Already have a fillthread");
|
assert(!fillthread_running() && "Already have a fillthread");
|
||||||
|
|
||||||
// We want to fill buffer_ by reading from fd. fd is the read end of a pipe; the write end is
|
// We want to fill buffer_ by reading from fd. fd is the read end of a pipe; the write end is
|
||||||
|
|
|
@ -253,7 +253,6 @@ int thread_pool_t::perform(void_function_t &&func, bool cant_wait) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void iothread_perform_impl(void_function_t &&func, bool cant_wait) {
|
void iothread_perform_impl(void_function_t &&func, bool cant_wait) {
|
||||||
ASSERT_IS_MAIN_THREAD();
|
|
||||||
ASSERT_IS_NOT_FORKED_CHILD();
|
ASSERT_IS_NOT_FORKED_CHILD();
|
||||||
s_io_thread_pool.perform(std::move(func), cant_wait);
|
s_io_thread_pool.perform(std::move(func), cant_wait);
|
||||||
}
|
}
|
||||||
|
|
|
@ -417,9 +417,6 @@ wcstring parser_t::stack_trace() const {
|
||||||
/// is of type FUNCTION_CALL. If the caller doesn't specify a starting position in the stack we
|
/// is of type FUNCTION_CALL. If the caller doesn't specify a starting position in the stack we
|
||||||
/// begin with the current block.
|
/// begin with the current block.
|
||||||
const wchar_t *parser_t::is_function(size_t idx) const {
|
const wchar_t *parser_t::is_function(size_t idx) const {
|
||||||
// PCA: Have to make this a string somehow.
|
|
||||||
ASSERT_IS_MAIN_THREAD();
|
|
||||||
|
|
||||||
for (size_t block_idx = idx; block_idx < block_list.size(); block_idx++) {
|
for (size_t block_idx = idx; block_idx < block_list.size(); block_idx++) {
|
||||||
const block_t &b = block_list[block_idx];
|
const block_t &b = block_list[block_idx];
|
||||||
if (b.is_function_call()) {
|
if (b.is_function_call()) {
|
||||||
|
@ -476,8 +473,6 @@ int parser_t::get_lineno() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
const wchar_t *parser_t::current_filename() const {
|
const wchar_t *parser_t::current_filename() const {
|
||||||
ASSERT_IS_MAIN_THREAD();
|
|
||||||
|
|
||||||
for (const auto &b : block_list) {
|
for (const auto &b : block_list) {
|
||||||
if (b.is_function_call()) {
|
if (b.is_function_call()) {
|
||||||
return function_get_definition_file(b.function_name);
|
return function_get_definition_file(b.function_name);
|
||||||
|
|
|
@ -168,8 +168,6 @@ int child_setup_process(pid_t new_termowner, pid_t fish_pgrp, const job_t &job,
|
||||||
/// FORK_LAPS times, with a very slight delay between each lap. If fork fails even then, the process
|
/// FORK_LAPS times, with a very slight delay between each lap. If fork fails even then, the process
|
||||||
/// will exit with an error message.
|
/// will exit with an error message.
|
||||||
pid_t execute_fork() {
|
pid_t execute_fork() {
|
||||||
ASSERT_IS_MAIN_THREAD();
|
|
||||||
|
|
||||||
if (JOIN_THREADS_BEFORE_FORK) {
|
if (JOIN_THREADS_BEFORE_FORK) {
|
||||||
// Make sure we have no outstanding threads before we fork. This is a pretty sketchy thing
|
// Make sure we have no outstanding threads before we fork. This is a pretty sketchy thing
|
||||||
// to do here, both because exec.cpp shouldn't have to know about iothreads, and because the
|
// to do here, both because exec.cpp shouldn't have to know about iothreads, and because the
|
||||||
|
|
Loading…
Reference in New Issue
Block a user