<commit_before>/*
 * Copyright 2012 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#ifndef SkCondVar_DEFINED
#define SkCondVar_DEFINED

#ifdef SK_USE_POSIX_THREADS
#include <pthread.h>
#elif defined(SK_BUILD_FOR_WIN32)
#include <windows.h>
#endif

/**
 * Condition variable for blocking access to shared data from other threads and
 * controlling which threads are awake.
 *
 * Currently only supported on platforms with posix threads and Windows Vista and
 * above.
 */
class SkCondVar {
public:
    SkCondVar();
    ~SkCondVar();

    /**
     * Lock a mutex. Must be done before calling the other functions on this object.
     */
    void lock();

    /**
     * Unlock the mutex.
     */
    void unlock();

    /**
     * Pause the calling thread. Will be awoken when signal() or broadcast() is called.
     * Must be called while lock() is held (but gives it up while waiting). Once awoken,
     * the calling thread will hold the lock once again.
     */
    void wait();
<commit_msg>Add thread safety configuration check.<commit_after>/*
 * Copyright 2012 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#ifndef SkCondVar_DEFINED
#define SkCondVar_DEFINED

/**
 * Import any thread model setting from configuration files.
 */
#include "SkTypes.h"

#ifdef SK_USE_POSIX_THREADS
#include <pthread.h>
#elif defined(SK_BUILD_FOR_WIN32)
#include <windows.h>
#else
/**
 * Warn if the implementation of this class is empty, i.e. thread safety is not working.
 */
#warning "Thread safety class SkCondVar has no implementation!"
#endif

/**
 * Condition variable for blocking access to shared data from other threads and
 * controlling which threads are awake.
 *
 * Currently only supported on platforms with posix threads and Windows Vista and
 * above.
 */
class SkCondVar {
public:
    SkCondVar();
    ~SkCondVar();

    /**
     * Lock a mutex. Must be done before calling the other functions on this object.
     */
    void lock();

    /**
     * Unlock the mutex.
     */
    void unlock();

    /**
     * Pause the calling thread. Will be awoken when signal() or broadcast() is called.
     * Must be called while lock() is held (but gives it up while waiting). Once awoken,
     * the calling thread will hold the lock once again.
     */
    void wait();

{'fraction_non_alphanumeric': 0.08963238331268071, 'fraction_numerical': 0.004956629491945477, 'mean_word_length': 3.0501672240802677, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5903260', 'n_tokens_mistral': 704, 'n_tokens_neox': 679, 'n_words': 302}