~ubuntu-branches/ubuntu/trusty/liburcu/trusty

« back to all changes in this revision

Viewing changes to urcu-call-rcu-impl.h

  • Committer: Package Import Robot
  • Author(s): Jon Bernard
  • Date: 2013-08-01 21:43:09 UTC
  • mfrom: (1.1.22)
  • Revision ID: package-import@ubuntu.com-20130801214309-xzzr0vswwilmywoh
Tags: 0.7.7-1
* [168b2c5] New upstream version 0.7.7
* [f07b6db] Bump Standards-Version to 3.9.4, no changes necessary
* [8f2716c] Remove backport patch for sparc, included upstream
* [10ec904] Include pkgconfig files in liburcu-dev package (Closes: #710544)
* [cfa7bd6] Prevent hiding of gcc commandline arguments

Show diffs side-by-side

added added

removed removed

Lines of Context:
81
81
 * CPUs rather than only to specific threads.
82
82
 */
83
83
 
84
 
#if defined(HAVE_SCHED_GETCPU) && defined(HAVE_SYSCONF)
 
84
#ifdef HAVE_SCHED_GETCPU
 
85
 
 
86
static int urcu_sched_getcpu(void)
 
87
{
 
88
        return sched_getcpu();
 
89
}
 
90
 
 
91
#else /* #ifdef HAVE_SCHED_GETCPU */
 
92
 
 
93
static int urcu_sched_getcpu(void)
 
94
{
 
95
        return -1;
 
96
}
 
97
 
 
98
#endif /* #else #ifdef HAVE_SCHED_GETCPU */
 
99
 
 
100
#if defined(HAVE_SYSCONF) && defined(HAVE_SCHED_GETCPU)
85
101
 
86
102
/*
87
103
 * Pointer to array of pointers to per-CPU call_rcu_data structures
124
140
        }
125
141
}
126
142
 
127
 
#else /* #if defined(HAVE_SCHED_GETCPU) && defined(HAVE_SYSCONF) */
 
143
#else /* #if defined(HAVE_SYSCONF) && defined(HAVE_SCHED_GETCPU) */
128
144
 
129
145
/*
130
146
 * per_cpu_call_rcu_data should be constant, but some functions below, used both
142
158
{
143
159
}
144
160
 
145
 
static int sched_getcpu(void)
146
 
{
147
 
        return -1;
148
 
}
149
 
 
150
 
#endif /* #else #if defined(HAVE_SCHED_GETCPU) && defined(HAVE_SYSCONF) */
 
161
#endif /* #else #if defined(HAVE_SYSCONF) && defined(HAVE_SCHED_GETCPU) */
151
162
 
152
163
/* Acquire the specified pthread mutex. */
153
164
 
350
361
 * Return a pointer to the call_rcu_data structure for the specified
351
362
 * CPU, returning NULL if there is none.  We cannot automatically
352
363
 * created it because the platform we are running on might not define
353
 
 * sched_getcpu().
 
364
 * urcu_sched_getcpu().
354
365
 *
355
366
 * The call to this function and use of the returned call_rcu_data
356
367
 * should be protected by RCU read-side lock.
492
503
                return URCU_TLS(thread_call_rcu_data);
493
504
 
494
505
        if (maxcpus > 0) {
495
 
                crd = get_cpu_call_rcu_data(sched_getcpu());
 
506
                crd = get_cpu_call_rcu_data(urcu_sched_getcpu());
496
507
                if (crd)
497
508
                        return crd;
498
509
        }