It seems like the browser you are using has JavaScript disabled. As a result, the site will not function properly. We really want you to enable it so you may experience our site as we intended it. If you have no idea what we are talking about or if you need help, visit http://www.enable-javascript.com×
This website uses cookies. By continuing to browse this site you are agreeing to our use of cookies. Find out more on our cookie page.×

Oops, it seems like you're using an old browser that we do not fully support. If you're able to, please upgrade your browser here.×
This website uses cookies. By continuing to browse this site you are agreeing to our use of cookies. Find out more on our cookie page.×

pthread_spin_init()

Synopsis:

Since:

Arguments:

spinner

A pointer to the pthread_spinlock_t object that you
want to initialize.

pshared

The value that you want to use for the process-shared attribute of the
spinlock.
The possible values are:

PTHREAD_PROCESS_SHARED — the spinlock may be
operated on by any thread that has access to the memory where the
spinlock is allocated, even if it's allocated in memory that's shared
by multiple processes.

PTHREAD_PROCESS_PRIVATE — the spinlock can be
operated on only by threads created within the same process as the
thread that initialized the spinlock.
If threads of differing processes attempt to operate on such a spinlock,
the behavior is undefined.

Library:

libc

Use the -l c option to
qcc
to link against this library.
This library is usually included automatically.

Description:

The pthread_spin_init() function allocates the resources required
for the thread spinlock spinner, and initializes
spinner to an unlocked state.

Any thread that can access the memory where spinner is allocated
can operate on the spinlock.

Results are undefined if you call pthread_spin_init() on a
spinner that's already initialized, or if you try to use a
spinlock that hasn't been initialized.

Returns:

Zero on success, or an error number to indicate the error.

Errors:

EAGAIN

The system doesn't have the resources required to initialize a new
spinlock.

EBUSY

The process spinlock, spinner, is in use by another thread and can't be
initialized.

EINVAL

Invalid pthread_spinlock_t object spinner.

ENOMEM

The system doesn't have enough free memory to create the new
spinlock.

1. Choose your focus

This is the focus controller. Use this controller to choose your primary development approach (Cascades or Core).

By selecting a focus, you get to decide what content should be front and center on the site.

2. Download the tools

Before you start developing, you'll need to visit the Downloads tab. Here you'll find downloads for the BlackBerry 10 Native SDK, BlackBerry 10 Device Simulator, and some other useful tools.

3. Try the sample apps

Now featuring a filter control, the Sample apps tab allows you to search for samples by name or by feature.

Select either the Core or Cascades check boxes to display the samples relevant to your focus.

4. Educate yourself

The Documentation tab contains tons of examples, tutorials, and best practices to guide you along the path towards building an awesome app.

The documentation for your preferred focus always appears at the top of the left-hand navigation, but you can still access the rest of the documentation at the bottom.

5. Start developing

The Reference tab is where you'll find essential details about how to use our APIs.

You can use the left-hand navigation to choose how you would like to browse the reference: by module, by topic, or alphabetically. If you have an idea of what you are looking for, start typing it in the Filter box.