Skip to content

Instantly share code, notes, and snippets.

Created November 7, 2019 18:29
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
#include "pch.h"
#include "task.h"
namespace AIMP
Task::Task(TaskFunc calledFunc)
: _func(calledFunc)
_func = nullptr;
void WINAPI Task::Execute(IAIMPTaskOwner* owner)
if (owner->IsCanceled()) return;
if (_func)
#pragma once
#include "unknown.h"
#include <functional>
namespace AIMP
#include "sdk/apiThreading.h"
using TaskFunc = void(__stdcall*)(IAIMPTaskOwner*);
//using TaskFunc = std::function<void(IAIMPTaskOwner*)>;
class Task
: public UnknownII<IAIMPTask>
Task(TaskFunc calledFunc);
void WINAPI Execute(IAIMPTaskOwner* owner) override;
TaskFunc _func;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment