[coroutine.handle.resumption]

# 17 Language support library [[support]](./#support)

## 17.13 Coroutines [[support.coroutine]](support.coroutine#coroutine.handle.resumption)

### 17.13.4 Class template coroutine_handle [[coroutine.handle]](coroutine.handle#resumption)

#### 17.13.4.6 Resumption [coroutine.handle.resumption]

[1](#1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/support.tex#L6044)

Resuming a coroutine via resume, operator(), or destroy on an execution agent other than the one on which it was suspended
has implementation-defined behavior
unless
each execution agent either is
an instance of std​::​thread or std​::​jthread,
or is the thread that executes main[.](#1.sentence-1)

[*Note [1](#note-1)*:

A coroutine that is resumed on a different execution agent should
avoid relying on consistent thread identity throughout, such as holding
a mutex object across a suspend point[.](#1.sentence-2)

â *end note*]

[*Note [2](#note-2)*:

A concurrent resumption of the coroutine can result in a data race[.](#1.sentence-3)

â *end note*]

[ð](#lib:operator(),coroutine_handle)

`void operator()() const;
void resume() const;
`

[2](#2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/support.tex#L6069)

*Preconditions*: *this refers to a suspended coroutine[.](#2.sentence-1)

The coroutine is not suspended at its final suspend point[.](#2.sentence-2)

[3](#3)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/support.tex#L6074)

*Effects*: Resumes the execution of the coroutine[.](#3.sentence-1)

[ð](#lib:destroy,coroutine_handle)

`void destroy() const;
`

[4](#4)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/support.tex#L6085)

*Preconditions*: *this refers to a suspended coroutine[.](#4.sentence-1)

[5](#5)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/support.tex#L6089)

*Effects*: Destroys the coroutine ([[dcl.fct.def.coroutine]](dcl.fct.def.coroutine "9.6.4 Coroutine definitions"))[.](#5.sentence-1)
