Ticket #185: python-gil-pruning-nodebug.patch
File python-gil-pruning-nodebug.patch, 2.0 KB (added by , 16 years ago) |
---|
-
Source/Modules/python.cxx
1474 1474 /* Last node in overloaded chain */ 1475 1475 1476 1476 int maxargs; 1477 int allow_thread = threads_enable(n);1478 1477 1479 1478 String *tmp = NewString(""); 1480 1479 String *dispatch; … … 1497 1496 Wrapper_add_local(f, "argc", "int argc"); 1498 1497 Printf(tmp, "PyObject *argv[%d]", maxargs + 1); 1499 1498 Wrapper_add_local(f, "argv", tmp); 1500 if (allow_thread)1501 thread_begin_block(n, f->code);1502 1499 1503 1500 if (!fastunpack) { 1504 1501 Wrapper_add_local(f, "ii", "int ii"); … … 1515 1512 1516 1513 Replaceall(dispatch, "$args", "self,args"); 1517 1514 1518 if (allow_thread) {1519 String *ret = NewStringEmpty();1520 thread_end_block(n, ret);1521 Append(ret, "return ");1522 Replaceall(dispatch, "return ", ret);1523 Delete(ret);1524 }1525 1526 1515 Printv(f->code, dispatch, "\n", NIL); 1527 1516 1528 if (allow_thread)1529 thread_end_block(n, f->code);1530 1531 1517 if (GetFlag(n, "feature:python:maybecall")) { 1532 1518 Append(f->code, "fail:\n"); 1533 1519 Append(f->code, "Py_INCREF(Py_NotImplemented);\n"); … … 1634 1620 kwargs = NewString(""); 1635 1621 1636 1622 int allow_thread = threads_enable(n); 1637 if (allow_thread)1638 thread_begin_block(n, f->code);1639 1623 1640 1624 Wrapper_add_local(f, "resultobj", "PyObject *resultobj = 0"); 1641 1625 … … 2066 2050 } 2067 2051 } 2068 2052 2069 if (allow_thread)2070 thread_end_block(n, f->code);2071 2053 Append(f->code, " return resultobj;\n"); 2072 2054 2073 2055 /* Error handling code */ … … 2076 2058 if (need_cleanup) { 2077 2059 Printv(f->code, cleanup, NIL); 2078 2060 } 2079 if (allow_thread)2080 thread_end_block(n, f->code);2081 2061 Printv(f->code, ctab4, "return NULL;\n", NIL); 2082 2062 2083 2063 … … 3562 3542 3563 3543 int allow_thread = threads_enable(n); 3564 3544 3565 if (allow_thread)3566 thread_begin_block(n, w->code);3567 3568 3545 if (allow_thread) { 3546 thread_begin_block(n, w->code); 3569 3547 Append(w->code, "{\n"); 3570 3548 } 3571 3549