File: CryptThreading.h

package info (click to toggle)
kodi 2%3A19.1%2Bdfsg2-2%2Bdeb11u1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 105,508 kB
  • sloc: cpp: 655,071; xml: 64,287; ansic: 37,640; sh: 8,574; python: 7,322; javascript: 2,325; makefile: 1,752; perl: 969; java: 513; cs: 390; objc: 340
file content (43 lines) | stat: -rw-r--r-- 1,093 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*
 *  Copyright (C) 2005-2018 Team Kodi
 *  This file is part of Kodi - https://kodi.tv
 *
 *  SPDX-License-Identifier: GPL-2.0-or-later
 *  See LICENSES/README.md for more information.
 */

#pragma once

//! @todo - once we're at OpenSSL 1.1 this class and its .cpp file should be deleted.
#if 0

#include <memory>
#include <vector>
#include "utils/GlobalsHandling.h"
#include "threads/CriticalSection.h"

class CryptThreadingInitializer
{
  std::vector<std::unique_ptr<CCriticalSection>> m_locks;
  CCriticalSection m_locksLock;

public:
  CryptThreadingInitializer();
  ~CryptThreadingInitializer();

  CCriticalSection* GetLock(int index);

  /**
   * This is so testing can reach the thread id generation.
   */
  unsigned long GetCurrentCryptThreadId();

private:
  CryptThreadingInitializer(const CryptThreadingInitializer &rhs) = delete;
  CryptThreadingInitializer& operator=(const CryptThreadingInitializer&) = delete;
};

XBMC_GLOBAL_REF(CryptThreadingInitializer,g_cryptThreadingInitializer);
#define g_cryptThreadingInitializer XBMC_GLOBAL_USE(CryptThreadingInitializer)

#endif