brintos

brintos / llvm-project-archived public Read only

0
0
Text · 791 B · 05403a3 Raw
28 lines · cpp
1//===-- Implementation of the tss_create ----------------------------------===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8 9#include "tss_create.h"10 11#include "src/__support/common.h"12#include "src/__support/macros/config.h"13#include "src/__support/threads/thread.h"14 15#include <threads.h>16 17namespace LIBC_NAMESPACE_DECL {18 19LLVM_LIBC_FUNCTION(int, tss_create, (tss_t * key, tss_dtor_t dtor)) {20  auto k = LIBC_NAMESPACE::new_tss_key(dtor);21  if (!k)22    return thrd_error;23  *key = *k;24  return thrd_success;25}26 27} // namespace LIBC_NAMESPACE_DECL28