Ignore:
Timestamp:
Mar 19, 2014, 11:31:01 PM (11 years ago)
Author:
dmik
Message:

python: Merge vendor 2.7.6 to trunk.

Location:
python/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • python/trunk

  • python/trunk/Python/thread_foobar.h

    r2 r391  
    1414PyThread_start_new_thread(void (*func)(void *), void *arg)
    1515{
    16         int success = 0;        /* init not needed when SOLARIS_THREADS and */
    17                                 /* C_THREADS implemented properly */
     16    int success = 0;            /* init not needed when SOLARIS_THREADS and */
     17                /* C_THREADS implemented properly */
    1818
    19         dprintf(("PyThread_start_new_thread called\n"));
    20         if (!initialized)
    21                 PyThread_init_thread();
    22         return success < 0 ? -1 : 0;
     19    dprintf(("PyThread_start_new_thread called\n"));
     20    if (!initialized)
     21        PyThread_init_thread();
     22    return success < 0 ? -1 : 0;
    2323}
    2424
     
    2626PyThread_get_thread_ident(void)
    2727{
    28         if (!initialized)
    29                 PyThread_init_thread();
    30 }
    31 
    32 static
    33 void do_PyThread_exit_thread(int no_cleanup)
    34 {
    35         dprintf(("PyThread_exit_thread called\n"));
    36         if (!initialized)
    37                 if (no_cleanup)
    38                         _exit(0);
    39                 else
    40                         exit(0);
     28    if (!initialized)
     29        PyThread_init_thread();
    4130}
    4231
     
    4433PyThread_exit_thread(void)
    4534{
    46         do_PyThread_exit_thread(0);
     35    dprintf(("PyThread_exit_thread called\n"));
     36    if (!initialized)
     37        exit(0);
    4738}
    48 
    49 void
    50 PyThread__exit_thread(void)
    51 {
    52         do_PyThread_exit_thread(1);
    53 }
    54 
    55 #ifndef NO_EXIT_PROG
    56 static
    57 void do_PyThread_exit_prog(int status, int no_cleanup)
    58 {
    59         dprintf(("PyThread_exit_prog(%d) called\n", status));
    60         if (!initialized)
    61                 if (no_cleanup)
    62                         _exit(status);
    63                 else
    64                         exit(status);
    65 }
    66 
    67 void
    68 PyThread_exit_prog(int status)
    69 {
    70         do_PyThread_exit_prog(status, 0);
    71 }
    72 
    73 void
    74 PyThread__exit_prog(int status)
    75 {
    76         do_PyThread_exit_prog(status, 1);
    77 }
    78 #endif /* NO_EXIT_PROG */
    7939
    8040/*
     
    8545{
    8646
    87         dprintf(("PyThread_allocate_lock called\n"));
    88         if (!initialized)
    89                 PyThread_init_thread();
     47    dprintf(("PyThread_allocate_lock called\n"));
     48    if (!initialized)
     49        PyThread_init_thread();
    9050
    91         dprintf(("PyThread_allocate_lock() -> %p\n", lock));
    92         return (PyThread_type_lock) lock;
     51    dprintf(("PyThread_allocate_lock() -> %p\n", lock));
     52    return (PyThread_type_lock) lock;
    9353}
    9454
     
    9656PyThread_free_lock(PyThread_type_lock lock)
    9757{
    98         dprintf(("PyThread_free_lock(%p) called\n", lock));
     58    dprintf(("PyThread_free_lock(%p) called\n", lock));
    9959}
    10060
     
    10262PyThread_acquire_lock(PyThread_type_lock lock, int waitflag)
    10363{
    104         int success;
     64    int success;
    10565
    106         dprintf(("PyThread_acquire_lock(%p, %d) called\n", lock, waitflag));
    107         dprintf(("PyThread_acquire_lock(%p, %d) -> %d\n", lock, waitflag, success));
    108         return success;
     66    dprintf(("PyThread_acquire_lock(%p, %d) called\n", lock, waitflag));
     67    dprintf(("PyThread_acquire_lock(%p, %d) -> %d\n", lock, waitflag, success));
     68    return success;
    10969}
    11070
     
    11272PyThread_release_lock(PyThread_type_lock lock)
    11373{
    114         dprintf(("PyThread_release_lock(%p) called\n", lock));
     74    dprintf(("PyThread_release_lock(%p) called\n", lock));
    11575}
Note: See TracChangeset for help on using the changeset viewer.