Ignore:
Timestamp:
Nov 27, 2012, 4:56:06 PM (13 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: updated vendor to 3.6.9

Location:
vendor/current/source3/lib/pthreadpool
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • vendor/current/source3/lib/pthreadpool/pthreadpool.c

    r740 r746  
    285285 */
    286286
    287 int pthreadpool_finished_job(struct pthreadpool *pool)
    288 {
    289         int result;
     287int pthreadpool_finished_job(struct pthreadpool *pool, int *jobid)
     288{
     289        int ret_jobid;
    290290        ssize_t nread;
    291291
     
    294294
    295295        while ((nread == -1) && (errno == EINTR)) {
    296                 nread = read(pool->sig_pipe[0], &result, sizeof(int));
     296                nread = read(pool->sig_pipe[0], &ret_jobid, sizeof(int));
    297297        }
    298298        if (nread == -1) {
     
    302302                return EINVAL;
    303303        }
    304         return result;
     304        *jobid = ret_jobid;
     305        return 0;
    305306}
    306307
  • vendor/current/source3/lib/pthreadpool/pthreadpool.h

    r740 r746  
    9191 *
    9292 * @param[in]   pool            The pool to query for finished jobs
    93  * @return                      The job_id of the finished job
     93 * @param[out]  pjobid          The job_id of the finished job
     94 * @return                      success: 0, failure: errno
    9495 */
    95 int pthreadpool_finished_job(struct pthreadpool *pool);
     96int pthreadpool_finished_job(struct pthreadpool *pool, int *jobid);
    9697
    9798#endif
  • vendor/current/source3/lib/pthreadpool/tests.c

    r740 r746  
    6969
    7070        for (i=0; i<num_jobs; i++) {
    71                 ret = pthreadpool_finished_job(p);
    72                 if ((ret < 0) || (ret >= num_jobs)) {
    73                         fprintf(stderr, "invalid job number %d\n", ret);
    74                         return -1;
    75                 }
    76                 finished[ret] += 1;
     71                int jobid = -1;
     72                ret = pthreadpool_finished_job(p, &jobid);
     73                if ((ret != 0) || (jobid >= num_jobs)) {
     74                        fprintf(stderr, "invalid job number %d\n", jobid);
     75                        return -1;
     76                }
     77                finished[jobid] += 1;
    7778        }
    7879
     
    276277
    277278                for (j=0; j<num_pools; j++) {
     279                        int jobid = -1;
    278280
    279281                        if ((pfds[j].revents & (POLLIN|POLLHUP)) == 0) {
     
    281283                        }
    282284
    283                         ret = pthreadpool_finished_job(pools[j]);
    284                         if ((ret < 0) || (ret >= num_jobs * num_threads)) {
     285                        ret = pthreadpool_finished_job(pools[j], &jobid);
     286                        if ((ret != 0) || (jobid >= num_jobs * num_threads)) {
    285287                                fprintf(stderr, "invalid job number %d\n",
    286                                         ret);
     288                                        jobid);
    287289                                return -1;
    288290                        }
    289                         finished[ret] += 1;
     291                        finished[jobid] += 1;
    290292                        received += 1;
    291293                }
Note: See TracChangeset for help on using the changeset viewer.